JavaScript - Flexslider Arrows Not In The Right Position
Similar Tutorialsmy website is at eduk8africa.org and on the slideshow i need to add arrows to be able to go to the next image. any help code is here : http://pastebin.com/mWNmydQD this needs to be done QUICK! Hi there, I am pretty new to javascript coding, and I could use little help... As you can see here, I got this code where I can move image inside of a box, and I do it by clicking these "links". And now I want to ask you, is there any way that I could move image using keys on keyboard (arrows or WSAD)? I'd like to keep this as simple as possible since I am not really into very advanced scripts (although I could probably understand them if you give little explanation). Code: <html> <head> <body> <script type="application/ecmascript"> // X position of image var x = 0; // Y position of image var y = 0; // Move per click var inc = 10; function Init() { document.getElementById('autic').style.left = x + 'px'; document.getElementById('autic').style.top = y + 'px'; } function moveRight() { x += inc; document.getElementById('autic').style.left = x + 'px'; } function moveLeft() { x -= inc; document.getElementById('autic').style.left = x + 'px'; } function moveUp() { y -= inc; document.getElementById('autic').style.top = y + 'px'; } function moveDown() { y += inc; document.getElementById('autic').style.top = y + 'px'; } </script> <style> #box { width: 500px; height: 300px; position: relative; margin: 20px auto 0px auto; border: 5px outset #000; overflow: hidden; } .image { position: absolute; z-index: 100; } </style> </head> <body onload="javascript:Init()"> <div id="box"><img class="image" id="autic" src="auto.png"/></div> <a href="javascript:moveLeft()">Left</a> <a href="javascript:moveUp()">Up</a> <a href="javascript:moveDown()">Down</a> <a href="javascript:moveRight()">Right</a> </body> </html> Hi I'm completely stuck, I am looking for placing small up and down arrows next to my textbox. They would work with by increasing/decreasing number of products. The text box would be active so a client could put the number of a product himself/herself or simply by clicking the up/down arrows next to the text box. I am not sure how to look for it, I mean I thought something like that should exist by default, I search w3c and I can find only combo box etc. Could someone put me on the right track please?.. Hi, I'm trying to write a function that will show arrowheads on polylines selected from a select box in a google map. I only want the arrowheads that belong to the line shown to be displayed. I have got it working using check boxes, and the select box shows the lines, but am having trouble tweaking the code to get the arrows to show up as well. You can see the working checkboxes (and the semi-working selectbox) he http://www.xelawho.com/map/zonesarrowstest.htm I see the error at line 135 ("Cannot read property 'onclick' of undefined") which I assume refers to the option, but this is where my limited js understanding begins to falter... how do I define the option if the select box options come from xml? And will defining it actually make this code work? Below are (what I think are) the relevant bits of code. Thanks in advance for any help. (cross-posted on the google maps forum and here over the last few days, but unanswered) Code: var h = 0; var v = 0; // === Function to create a marker arrow === function createArrow(point,icon,category) { var arrows = new GMarker(point,icon); map.addOverlay(arrows); pts[v] = arrows; arrows.hide(); arrows.mycategory = category; pts.push(arrows); } var select_html = '<select onChange="handleSelected2(this)">' + "selclick(this)" + '<option selected> - Select a bus route - <\/option>'; function showsel(category) { for (var v=0; v<pts.length-1; v++) { if (pts[v].mycategory == category) { pts[v].show(); } } document.getElementById(category+"option").onclick = true; } function hidesel(category) { for (var v=0; v<pts.length-1; v++) { if (pts[v].mycategory == category) { pts[v].hide(); } } } function selclick(option,category) { if (option.onclick) { showsel(category); } else { hidesel(category); } } function handleSelected2(opt,category) { for (var h = 0; h <gpolylines.length; h++) { gpolylines[h].hide(); } var h = opt.selectedIndex - 1; if (h > -1) { gpolylines[h].show(); } for (var v=0; v<pts.length; v++) { selclick(category); } } GDownloadUrl("allzonesencoded.xml", function(doc) { var xmlDoc = GXml.parse(doc); var lines = xmlDoc.documentElement.getElementsByTagName("line"); for (var i=0; i< pts.length; i++) { var category = lines[a].getAttribute("category"); } // ===== final part of the select box ===== select_html += '<\/select>' ; document.getElementById("selection2").innerHTML = select_html; I'm new to javascript and am not sure why this works in firefox and not chrome. I am trying to create a script that keeps an object fixed horizontally while bing positioned absolute vertically. if I replace the toPP variable in document.getElementById('fire').style.top = toPP; with say '50px' it will move the element down 50 pxs, but how I have it currently it doesn't do anything in chrome Code: <script type="text/javascript" > window.onscroll = function() { if( window.XMLHttpRequest ) { var x = 0 -document.documentElement.scrollTop; var toP = String(x); var toPP = toP + "px"; document.getElementById('fire').style.position = 'fixed'; document.getElementById('fire').style.top = toPP; } } </script> I need to convert a position:fixed element to position:absolute when the user resize their browser window below 1000px. Right now it does nothing. The element always keeps the fixed positioning even after resizing the window. Here's what I have right now: Code: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <base href="http://www.area51entertainment.co/" /> <title>Emoto <?php echo "$section"; ?></title> <meta charset="UTF-8" /> <meta name="verify-v1" content="" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta name="author" content="Andrew McCarrick" /> <meta name="robots" content="index, follow" /> <style type="text/css"> body,html { background: #FFFFFF; /* Old browsers */ color: #000000; font-family: Verdana; margin-right:auto; margin-left:auto; max-width:1000px; padding: 0px; margin-top: 0px; margin-bottom: 0px; } </style> <link rel="stylesheet" href="emoto/style.css" media="screen" /> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" /> <link rel="apple-touch-icon" href="http://www.area51entertainment.co/TouchIcon.png" /> <link rel="apple-touch-icon-precomposed" href="http://www.area51entertainment.co/TouchIcon.png" /> <link rel="image_src" href="./logo.png" /> <script language="javascript" src="emoto/float.js"></script> </head> <body> <div class="wrapper"> <div id="header_float"> <div class="header_wrapper"> <div class="logo"> Picture </div> <div class="links"> Home | Settings | Notifications | Requests | Messages | Search Bar </div> <div class="links_right"> Profile Link/Sign-Out </div> </div> </div> <div class="content_wrapper"> Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 T est2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2 </div> </div> </body> </html> style.css Code: a:link {color: #FFFFFF; text-decoration: none;} a:visited {color: #FFFFFF; text-decoration: none;} a:active {color: #FFFFFF; text-decoration: none;} a:hover {color: #3399FF; text-decoration: none;} .wrapper{ min-height: 2000px; min-width: 1000px; } #header_float{ width: 100%; min-width: 1000px; height: 35px; left:0; right:0; top:0; position: fixed; background: #49963A; z-index: 1000; } .header_wrapper{ width: 1000px; height: 35px; margin-right:auto; margin-left:auto; padding: 0px; margin-top: 0px; margin-bottom: 0px; color: #FFFFFF; } .logo{ float: left; width: 150px; height: 25px; font-size: 26px; position: relative; top: -1px; left: 8px; } .links{ float: left; width: 670px; height: 25px; position: relative; top: 7px; } .links_right{ float: right; width: 180px; height: 25px; position: relative; top: 7px; } .content_wrapper{ position: relative; top: 35px; width: 995px; min-height: 450px; } img{ border: 0px; } float.js Code: if (screen.availWidth<=999) document.getElementById('header_float').style.position = 'absolute'; else document.getElementById('header_float').style.position = 'fixed'; Hi, i am simply trying to alert the left position of a css layer. Javascript: Code: var Element = document.getElementById('box'); alert(Element.style.left); CSS Code: #box {position:absolute; left:150px; top:150px; background-color:blue; height:100; width:100;} HTML Code: <div id="box"> </div> The problem is the alert is blank and i can't understand why. thanks What is "lb-position" and how is it used? It's used in a lightbox tutorial, and in looking for an explanation I've found it in a handful of places, but I don't know what it is or what it does. Thank you.
Theoretically this code was supposed to be ok isn't it? But nothing is happening! help! is there any way to fix the position of a draggable div in a table which is having fixed width and height??
Hi, Im trying to change the position of a div when a button is clicked. The js is: Code: function curPos() { objDivStrip = document.getElementById('thumbview'); return objDivStrip.style.top; } function up(pos) { //get objects objImgStrip = document.getElementById('str'); objDivStrip = document.getElementById('thumbview'); //Get End position var totImg = (objImgStrip.height - 100) / 130; var endpos = totImg * 130; if (pos=endpos) { return false; } else { objDivStrip.style.top = pos - 130; } } and the html on the button is Code: <img id="arrow" src="images/arrow_up.jpg" onclick="up(curPos());" /> The code doesnt work but if anyone could point me in the direction to get it to work your help is greatly appreciated. Cheers Sol I am creating calander control for the 1 year using javascript.the day in which click a table is pop up at absloute position . i want table is popup at relative position where selected date is click. Here is my code <script language="javascript" type="text/javascript"> var k=0; var month; var pagedata; var check=0; var tabledata = ''; var counter = 0; var editVal=0; var editRow=0; var selecteditemcode=""; var counter=0; function day_title(day_name) { mycurrent_cell = document.createElement("td"); currenttext = document.createTextNode(String(day_name)); mycurrent_cell.appendChild(currenttext); } function makeArray(n) { this.length=n; for (var i = 1; i <= n; i++) this[i] = 0 return this } var flag=false; var index; var tempdata; var mybody ; var rowData = new Array(); var colData = new Array(); var mytable function fill_table(m_name,m_length,mm) { counter+=1; if(k==0) { alert(this_month); k=this_month; } else { alert(k); k +=1; if(k>12) { alert(k); alert(this_year); if(flag==false) { this_year+=1; flag=true; alert("IN "+k); alert("IN "+this_year); } } } mybody = document.getElementById('showtb'); mytable= document.createElement("table"); mytable.setAttribute("id",+String(m_name)+"_"+String(this_year)); mytablebody = document.createElement("tbody"); head_row = document.createElement("tr"); head_cell = document.createElement("td"); headtext = document.createTextNode(String(m_name)+"_"+String(this_year)); head_cell.appendChild(headtext); head_cell.setAttribute('colSpan','7'); head_row.appendChild(head_cell); head_cell.setAttribute('className','titlebar'); head_row.appendChild(head_cell); mytablebody.appendChild(head_row); mycurrent_row = document.createElement("tr"); counter+=1; mycurrent_row.setAttribute("id",String(counter)); mycurrent_cell = document.createElement("td"); currenttext = document.createTextNode("Sun"); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); mycurrent_cell = document.createElement("td"); currenttext = document.createTextNode("Mon"); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); mycurrent_cell = document.createElement("td"); currenttext = document.createTextNode("Tue"); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); mycurrent_cell = document.createElement("td"); currenttext = document.createTextNode("Wed"); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); mycurrent_cell = document.createElement("td"); currenttext = document.createTextNode("Thu"); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); mycurrent_cell = document.createElement("td"); currenttext = document.createTextNode("Fri"); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); mycurrent_cell = document.createElement("td"); currenttext = document.createTextNode("Sat"); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); mytablebody.appendChild(mycurrent_row); day=1 if(m_name=="February" ) { if((this_year%4)==0) { m_length +=1; } } pagedata=''; var ddl; counter +=2; mycurrent_row = document.createElement("tr"); mycurrent_row.setAttribute("id",counter); for (var i=1;i<start_day;i++) { if(start_day<8) { mycurrent_cell = document.createElement("td"); currenttext = document.createTextNode(" "); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); mycurrent_cell.setAttribute('className','promptbox'); mycurrent_row.appendChild(mycurrent_cell); } } var blnFlagFirstline=false; for (var i=start_day;i<8;i++) { blnFlagFirstline=true; alert("this_day "+ this_day+ " i "+ i); if(blgFlagButtons==false) { if(this_day <=day) { mycurrent_cell = document.createElement("td"); currenttext = document.createElement("a"); currenttext.setAttribute("href", "javascript:fnDivertedFlight();"); currenttext.setAttribute("onClick","this.blur();"); var txt = document.createTextNode(""+String(day)); currenttext.appendChild(txt); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); blgFlagButtons=true; } else { if(blgFlagButtons==false) { mycurrent_cell = document.createElement("td"); currenttext = document.createTextNode(""+String(day)); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); } else { mycurrent_cell = document.createElement("td"); currenttext = document.createElement("a"); currenttext.setAttribute("href", "javascript:fnDivertedFlight();"); currenttext.setAttribute("onClick","this.blur();"); var txt = document.createTextNode(""+String(day)); currenttext.appendChild(txt); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); } } } else { mycurrent_cell = document.createElement("td"); currenttext = document.createElement("a"); currenttext.setAttribute("href", "javascript:fnDivertedFlight();"); currenttext.setAttribute("onClick","this.blur();"); var txt = document.createTextNode(""+String(day)); currenttext.appendChild(txt); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); } day++; } if(blnFlagFirstline==true) { mytablebody.appendChild(mycurrent_row); } counter+=1; mycurrent_row = document.createElement("tr"); mycurrent_row.setAttribute("id",counter); while (day <= m_length) { for (var i=1;i<=7 && day<=m_length;i++) { if(blgFlagButtons==false) { if(this_day <=day) { mycurrent_cell = document.createElement("td"); currenttext = document.createElement("a"); currenttext.setAttribute("href", "javascript:fnDivertedFlight();"); currenttext.setAttribute("onClick","this.blur();"); var txt = document.createTextNode(""+String(day)); currenttext.appendChild(txt); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); blgFlagButtons=true; } else { mycurrent_cell = document.createElement("td"); currenttext = document.createTextNode(String(day)); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); } } else { mycurrent_cell = document.createElement("td"); currenttext = document.createElement("a"); currenttext.setAttribute("href", "javascript:fnDivertedFlight();"); currenttext.setAttribute("onClick","this.blur();"); var txt = document.createTextNode(""+String(day)); currenttext.appendChild(txt); mycurrent_cell.appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell); } day++ } mytablebody.appendChild(mycurrent_row); counter+=1; mycurrent_row = document.createElement("tr"); mycurrent_row.setAttribute("id",counter); } mytable.appendChild(mytablebody); mybody.appendChild(mytable); mytable.setAttribute("border", "10"); //mytable.style.background="aliceblue"; mytable.style.fontFamily="Verdana"; //mytable.style.width="1000px"; mytable.setAttribute("className","promptbox"); mytable.style.fontSize="10pt"; start_day = i } var blgFlagButtons; function fnCalender() { blgFlagButtons=false; month=new makeArray(12) month[1]="January" month[2]="February" month[3]="March" month[4]="April" month[5]="May" month[6]="June" month[7]="July" month[8]="August" month[9]="September" month[10]="October" month[11]="November" month[12]="December" month_length = new makeArray(12) month_length[1]=31 month_length[2]=28 month_length[3]=31 month_length[4]=30 month_length[5]=31 month_length[6]=30 month_length[7]=31 month_length[8]=31 month_length[9]=30 month_length[10]=31 month_length[11]=30 month_length[12]=31 today = new Date() today= new Date("July 13, 2008");//'Wed Oct 29 00:00:00 UTC+530 2008' this_day = today.getDate() this_month = today.getMonth()+1 this_year = today.getYear() this_year = (this_year< 1000) ? this_year + 1900 : this_year; begin_date = new Date("July 01, "+this_year) if((this_year%4)==0) { start_day = begin_date.getDay()+1 } else { start_day = begin_date.getDay()+1 } var MhVal; if(this_day>1) { MhVal=this_month; for(var i=1; i<=13;i++) { mon[i]=month[MhVal]; monlen[i]=month_length[MhVal] MhVal +=1 if(MhVal==13) { MhVal=1; } } } else { MhVal=this_month; for(var i=1; i<=12;i++) { mon[i]=month[MhVal]; monlen[i]=month_length[MhVal] MhVal +=1 if(MhVal==13) { MhVal=1; } } } if (start_day == 1){ start_day = 8 } if(this_day>1) { for (var m = 1;m<=13;m++){ //alert('month[m] - '+mon[m]+' month_length[m] - '+monlen[m]+' m - ' +m); fill_table(mon[m],monlen[m],m) // tabledata += "id"+counter+"="+pagedata; } } else { for (var n = 1;n<=12;n++){ fill_table(mon[n],monlen[n],n) } } } </script> <script language="javascript" type="text/javascript"> function fnDivertedFlight() { prompt3('', 'Roster','Diverted Flight Detail </B>', 'fnDivertedValues'); } function prompt3(promptpicture, prompttitle, message, sendto) { var posx = 0; var posy = 0; var e = window.event; if(e!=null) { if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } } else { posx = 100; posy = 100; } promptbox = document.createElement('div'); promptbox.setAttribute ('id' , 'prompt') document.getElementsByTagName('body')[0].appendChild(promptbox) promptbox = eval("document.getElementById('prompt').style") promptbox.position = 'absolute' promptbox.top = posy promptbox.left = posx promptbox.width = 430 promptbox.border = 'outset 1 #bbbbbb' //Here I am open popup Tabletable } function fnDivertedValues(value1,value2,value3,value4,value6,value7,value5) { alert(value1+" , "+ value2+" , "+value3+" , "+value4+" , "+value5); So, here is my question: Is there some possibility to put the horizontal scroll bar of the web browser into the center if the "width" of web page are bigger then the "width" of the web browser screen? So I don't need to scroll to right if I open the page, but the horizontal scroll bar will be positioned in the center. That code should do the same think like I when I take the scroll bar and put it in the center position, but this should be happen when I load the page automatically. Or how can I do that? thanks to all . . . is it possible to make the mouse be at a given position on the screen using javascript for example i am writing a element resize script and i would like to have it so when u click on the resize button the cursor moves to the bottom right corner of the element for the starting position
Hello I am hoping to position some JavaScript on a Web page. Would I use something like this: CSS Code: #diagram { margin-left: 200px; margin-top: 100px; } HTML <script>JavaScript code here</script> <div id="diagram" </div> Thanks for any advice. This code works great for splitting value to textbox.. However; It quits working in example 2 when I move the select outside the form tags Code: <!-- EXAMPLE 1 WORKS--> <script type="text/javascript"> function Split(sel,first) { if (sel.selectedIndex == 0 ) return; var temp = sel.value.split(","); sel.form["F"+first].value = temp[0]; sel.form["F"+(first+1)].value = temp[1]; sel.form["F"+(first+2)].value = temp[2]; } </script> <form method='post'> <input type="text" name="F1" value="" > <input type="text" name="F2" value="" > <input type="text" name="F3" value="" > <select onChange="Split(this,1)"> <option> ===Select Color ==== </option> <option value='000,000,000'>black</option> <option value='169,169,169'>grey</option> <option value='000,000,255'>blue</option> <option value='153 102,255'>aqua</option> </select> </form> Help with the onChange to work outside the form tags. Code: <!-- EXAMPLE 2 NEED HELP--> <script type="text/javascript"> function Split(sel,first) { if (sel.selectedIndex == 0 ) return; var temp = sel.value.split(","); sel.form1["F"+first].value = temp[0]; sel.form1["F"+(first+1)].value = temp[1]; sel.form1["F"+(first+2)].value = temp[2]; } </script> <form method='post' name="form1"> <input type="text" name="F1" value="" > <input type="text" name="F2" value="" > <input type="text" name="F3" value="" > </form> <!-- NEED TO MODIFY THE ONCHANGE TO WORK IN THIS POSITON?? --> <select onChange="Split(this.form1.value,1)"> <option> ===Select Color ==== </option> <option value='000,000,000'>black</option> <option value='169,169,169'>grey</option> <option value='000,000,255'>blue</option> <option value='153 102,255'>aqua</option> </select> hi! i would just like to say first of all, that i only use forums for help unless i've exacerbated all other forms of help as i am such a javascript noob! so please bear with my while i try to explain my problem... i've isolated the javascripts to this page > http://nang-nang.net/tumblr/blog/help.html in this example the plant image is using lightbox 2 and the bird.gif is using prototip2 to create a tooltip (that displays my latest tweet) (i should mention that these scripts will be used to pimp out my tumblr blog/portfolio http://bubblejam.tumblr.com eventually) the problem: i need the tooltip to stay put! i've managed to put the bird in a <div style="position:fixed..." etc so that's fine. but the tooltip isn't fixed and moves as the page scrolls down! can anyone take a look at what javascript i've got so far and fingers crossed there's a simple solution! thanks!! Currently working on a slideshow for this website, and I've used the same code in the past but because I am now working with a wordpress template I'm having some problems. Link to slideshow The next image is loading underneath the current image and then moving up, which I need them images to stay in place of course. Code: <div id="lookbook"> <a href="http://www.axandapple.com/store/?cat=71" target="_self"><ul class="ppt"> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-1.jpg" ALT="Ax+Apple Presents The Witching Hour Collection"></li> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-2.jpg" ALT="Ax+Apple Nyx & Orion Necklaces"></li> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-3.jpg" ALT="Ax+Apple Odessa & Oracle Necklaces"></img></li> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-4.jpg" ALT="Ax+Apple Jupiter & Naja Necklaces"></img></li> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-5.jpg" ALT="Ax+Apple Nyx & Orion Necklaces"></img></li> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-6.jpg" ALT="Ax+Apple Odessa & Oracle Necklaces and Snake Charmer Bracelet"></img></li> <li><img src="http://axandapple.com/store/wp-content/themes/eCommerce/images/AxAndApple_WitchingHour_Elza-7.jpg" ALT="Ax+Apple Jupiter & Naja Necklaces and Asteria Earrings"></img></li> </ul></a> <p style="text-align:center;"><button type="button" id="back">Back</button> <button type="button" id="stop">Pause</button> <button type="button" id="play">Play</button> <button type="button" id="fwd">Forward</button></p> </div> <p>2011 Ax+Apple</p> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> $('.ppt li:gt(0)').hide(); $('.ppt li:last').addClass('last'); $('.ppt li:first').addClass('first'); $('#play').hide(); var cur = $('.ppt li:first'); var interval; $('#fwd').click( function() { goFwd(); showPause(); } ); $('#back').click( function() { goBack(); showPause(); } ); $('#stop').click( function() { stop(); showPlay(); } ); $('#play').click( function() { start(); showPause(); } ); function goFwd() { stop(); forward(); start(); } function goBack() { stop(); back(); start(); } function back() { cur.fadeOut( 1000 ); if ( cur.attr('class') == 'first' ) cur = $('.ppt li:last'); else cur = cur.prev(); cur.fadeIn( 1000 ); } function forward() { cur.fadeOut( 1000 ); if ( cur.attr('class') == 'last' ) cur = $('.ppt li:first'); else cur = cur.next(); cur.fadeIn( 1000 ); } function showPause() { $('#play').hide(); $('#stop').show(); } function showPlay() { $('#stop').hide(); $('#play').show(); } function start() { interval = setInterval( "forward()", 3000 ); } function stop() { clearInterval( interval ); } $(function() { start(); } ); </script> Code: #lookbook{ position:relative; } ul.ppt{ position:absolute; height:699px; } .ppt li{ list-style-type:none; position:absolute; top:0px; left:0px; height:699px; } .ppt img{ background-color:#FFF; padding:5px; top:0px; position:absolute; } #lookbook p{ text-align:center; z-index:99; } #lookbook button{ background-color:#FFF; border:0; padding:0 3px 0 3px; color:#000; font:12px "Courier", "Courier New", Courier, monospace; } hello guys, I need help I got simple page with two iframes in it Code: <iframe src="aaa" height="48%" width="100%"></iframe> <iframe src="bbb" height="48%" width="100%"></iframe> and I need when I load the page scrollbars position will be like 20% down like this http://img198.imageshack.us/img198/8935/scrollsw.png how can I do this? thank you hi all, I was wondering if someone could help me about my problem I want to change the position of my div when the user scroll the page. Example: <div style="position:absolute;bottom:10px;> Scrolling text </div> I want to change the position to fixed when the user scroll the page using javascript. hope you could help. |