JavaScript - Script Needed For Scrolling Div With Particular Features
Hi,
I am looking for a script for a scrolling DIV with the following features: 1. DIV can be scrolled vertically using mousewheel/trackpad/finger on iPad 2. Up/Down buttons which scroll slowly on hover and fast on click 3. The DIV to be scrolled will contain an audio playlist, generated by jPlayer, written in javascript. This script has a DIV for the currently playing track, and can launch functions on track change. I would like the scrolling DIV to scroll automatically to the currently playing song when the track changes. Any help to get me going on this would be appreciated, Thanks Nick Similar TutorialsHi I am trying to implement a scroll to DIV (i.e. smooth scrolling with some easing) on various events in jPlayer, a javascript audio playlist. Essentially the playlist is in a scrolling DIV with scrollbars and mousewheel scrolling, and when the track changes I would like it to trigger a scroll to the currently playing track, i.e. the new track, such that it is centred vertically in the DIV (which has a variable height). I thought I would start first with trying to add some code to the #jplayer_next event which usually looks like this: Code: $("#jplayer_next").click( function() { playListNext(); $(this).blur(); return false; }); I came up with the following code to add: Code: $("#jplayer_playlist").scrollTop($(".jplayer_playlist_current").offset().top); where #jplayer_playlist is the scrolling DIV and .jplayer_playlist_current is the class of the currently playing track. The code does do something, but I am seeing fairly nonsensical jumping around the div, which does seem somewhat related to the currently playing track, but certainly not what I am looking for. You can see the playlist here. The currently playing track is highlighted in green, and, when you click on the next button, the DIV certainly isn't scrolling smoothly to the currently playing track! If someone could help me amend the code to get this working properly I'd be grateful. Thanks, Nick I'm building a website with scrolling images at the top, I managed to find some code which seemed to work fine but then when I uploaded it to the server there were suddenly huge gaps between the images. www.s-remy.com/B/index.html here's the code for the scrolling Code: <script type="text/javascript"> <!-- // ********** User Defining Area ********** data=[ ["scroll1.png","",""], ["scroll3.png","",""] // no comma at end of last index ] imgPlaces=40 // number of images visible imgWidth=50 // width of the images imgHeight=81 // height of the images imgSpacer=4 // space between the images dir=0 // 0 = left, 1 = right newWindow=0 // 0 = Open a new window for links 0 = no 1 = yes // ********** End User Defining Area ********** moz=document.getElementById&&!document.all step=1 timer="" speed=50 nextPic=0 initPos=new Array() nowDivPos=new Array() function initHIS3(){ for(var i=0;i<imgPlaces+1;i++){ // create image holders newImg=document.createElement("IMG") newImg.setAttribute("id","pic_"+i) newImg.setAttribute("src","") newImg.style.position="absolute" newImg.style.width=imgWidth+"px" newImg.style.height=imgHeight+"px" newImg.style.border=0 newImg.alt="" newImg.i=i newImg.onclick=function(){his3Win(data[this.i][2])} document.getElementById("display_area").appendChild(newImg) } containerEL=document.getElementById("his3container") displayArea=document.getElementById("display_area") pic0=document.getElementById("pic_0") containerBorder=(document.compatMode=="CSS1Compat"?0:parseInt(containerEL.style.borderWidth)*2) containerWidth=(imgPlaces*imgWidth)+((imgPlaces-1)*imgSpacer) containerEL.style.width=containerWidth+(!moz?containerBorder:"")+"px" containerEL.style.height=imgHeight+(!moz?containerBorder:"")+"px" displayArea.style.width=containerWidth+"px" displayArea.style.clip="rect(0,"+(containerWidth+"px")+","+(imgHeight+"px")+",0)" imgPos= -pic0.width for(var i=0;i<imgPlaces+1;i++){ currentImage=document.getElementById("pic_"+i) if(dir==0){imgPos+=pic0.width+imgSpacer} // if left initPos[i]=imgPos if(dir==0){currentImage.style.left=initPos[i]+"px"} // if left if(dir==1){ // if right document.getElementById("pic_"+[(imgPlaces-i)]).style.left=initPos[i]+"px" imgPos+=pic0.width+imgSpacer } if(nextPic==data.length){nextPic=0} currentImage.src=data[nextPic][0] currentImage.alt=data[nextPic][1] currentImage.i=nextPic currentImage.onclick=function(){his3Win(data[this.i][2])} nextPic++ } scrollHIS3() } timer="" function scrollHIS3(){ clearTimeout(timer) for(var i=0;i<imgPlaces+1;i++){ currentImage=document.getElementById("pic_"+i) nowDivPos[i]=parseInt(currentImage.style.left) if(dir==0){nowDivPos[i]-=step} if(dir==1){nowDivPos[i]+=step} if(dir==0&&nowDivPos[i]<= -(pic0.width+imgSpacer) || dir==1&&nowDivPos[i]>containerWidth){ if(dir==0){currentImage.style.left=containerWidth+imgSpacer+"px"} if(dir==1){currentImage.style.left= -pic0.width-(imgSpacer*2)+"px"} if(nextPic>data.length-1){nextPic=0} currentImage.src=data[nextPic][0] currentImage.alt=data[nextPic][1] currentImage.i=nextPic currentImage.onclick=function(){his3Win(data[this.i][2])} nextPic++ } else{ currentImage.style.left=nowDivPos[i]+"px" } } timer=setTimeout("scrollHIS3()",speed) } function stopHIS3(){ clearTimeout(timer) } function his3Win(loc){ if(loc==""){return} if(newWindow==0){ location=loc } else{ //window.open(loc) newin=window.open(loc,'win1','left=430,top=340,width=300,height=300') // use for specific size and positioned window newin.focus() } } // add onload="initHIS3()" to the opening BODY tag // --> I'm not very familiar with JavaScript so I can't find any issues with it. I've tried changing the imgspace value but it doesn't seem to work? My bad if this was answered somewhere else. I did search the forums but was unable to locate an answer (It is kind of a specific question) I have an odd problem. I have the following clock script: Code: function Clock() { var today=new Date(); var h=today.getHours(); var m=today.getMinutes(); var s=today.getSeconds(); // add lead zeros to numbers less than 10 h=checkTime(h); m=checkTime(m); s=checkTime(s); document.getElementById('Clock').innerHTML=h+":"+m+":"+s; t=setTimeout('Clock'), 500); } function checkTime(i) { if (i<10) { i="0" + i; } return i; } Loaded at the page load and assigned to a div: Code: <body onLoad = "Clock();"> <!--the clock--> <div align = "right" id = "Clock"></div> With this style applied: Code: #Clock {font-size: 30pt; position: fixed; top: 0px; right: 0px; background: #ffffff; z-index: 3; } The problem I've run into is this: In Chrome, whenever I scroll down, even by just one tap/click of the down arrow, the clock stops updating the time in, pardon the pun, real-time. But the second I scroll completely to the top of the page, it goes back to counting. I tested in the current (as of Nov 20th 2010) versions of FireFox, Opera and IE9 and the only browser that seems to produce this problem is Chrome. Any ideas? Hi everyone, I'm curious if this is something simple. I'm working on a wordpress site using a plugin that is based off of the code from javascript kit called "highlighter scroller script". The plugin js is almost identical: http://javascriptkit.com/script/cut57.shtml What is causing it to wipe from left to right? I'm racking my brains trying to figure it out (and googling unsuccessfully it seems). All I'm trying to do is make it wipe instead from right to left. I'm sure it's something simple, but I don't know which variable to change. Can anyone point me in the right direction? THANKS! the following script opens a video and plays the video is there anyway to have it list all the flv files in a folder and make it play the video onclick something like a web photo album but for video's all with the same extension the file name that would need to be replaced is detecting.flv Code: <html><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!-- A minimal Flowplayer setup to get you started --> <!-- include flowplayer JavaScript file that does Flash embedding and provides the Flowplayer API. --> <script type="text/javascript" src="flowplayer-3.2.6.min.js"></script> <!-- some minimal styling, can be removed --> <link rel="stylesheet" type="text/css" href="style.css"> <!-- page title --> <title>detecting finds</title> </head><body> <div id="page"> <p style="text-align: center">Franks website</p> <!-- this A tag is where your Flowplayer will be placed. it can be anywhere --> <a href="http://franks.com/movies/detecting.flv" style="display:block;width:520px;height:330px" id="player"> </a> <!-- this will install flowplayer inside previous A- tag. --> <script> flowplayer("player", "http://franks.com/movies/flowplayer-3.2.7.swf"); </script> </div> </body></html> Hello Everyone , I hope you to help me with this situation , if for example we go through this link Code: http://travel.maktoob.com/vb//redirectLink.php?link=http%3A%2F%2Frapidshare.com%2Ffiles%2F246270511%2FGarmin_WorldMap_v4.part1.rar the iframe will be removed because the rapidshare is using this code Code: <script type="text/javascript"> if (top != self) top.location = self.location; if (document.URL.substr(7,7) == "intern.") document.write('<base href="http://rapidshare.com">'); </script> So how to prevent this code from removing my iframe ? I really really hope to get an solution for this . Thank you too much , Zi5 Hello everyone. First, if you do not understand something I have tried to explain, PLEASE ask, don't just skip the question! Thank you! I will start by explaining what I am doing and why I am running into a problem. Perhaps one of you kind people can help me figure out how to fix it. I have a grid set up for logic puzzle solving. The grid is made up of 3 rows of primary squares, each containing 16 sub-squares. The top row has 3 primary squares. the 2nd row has 2 primary squares. the 3rd row has 1 primary square. That gives a total of 96 sub-square, or grid coordinates. Each sub square has an image in it that can be altered by clicking the square. The image begins as a blank gif. With the first click, it becomes an X, with a second click, it becomes an O, and the third click returns it to blank. With me so far? Hope so! Now for the tricky part. The grid is made up using a table, with each TD having it's own identifier, as in: Code: a1b1 a1b2 a1b3 a1b4 | a1c1 a1c2 a1c3 a1c4 | a1d1 a1d2 a1d3 a1d4 a2b1 a2b2 a2b3 a2b4 | a2c1 a2c2 a2c3 a2c4 | a2d1 a2d2 a2d3 a2d4 a3b1 a3b2 a3b3 a3b4 | a3c1 a3c2 a3c3 a3c4 | a3d1 a3d2 a3d3 a3d4 a4b1 a4b2 a4b3 a4b4 | a4c1 a4c2 a4c3 a4c4 | a4d1 a4d2 a4d3 a4d4 ----------------------------------------- d1b1 d1b2 d1b3 d1b4 | d1c1 d1c2 d1c3 d1c4 d2b1 d2b2 d2b3 d2b4 | d2c1 d2c2 d2c3 d2c4 d3b1 d3b2 d3b3 d3b4 | d3c1 d3c2 d3c3 d3c4 d4b1 d4b2 d4b3 d4b4 | d4c1 d4c2 d4c3 d4c4 ----------------------------------------- c1b1 c1b2 c1b3 c1b4 c2b1 c2b2 c2b3 c2b4 c3b1 c3b2 c3b3 c3b4 c4b1 c4b2 c4b3 c4b4 Each sub-square also contains the image that is changed, and the image has it's own unique identifier, to go alone with the grid: Code: 1-0-0 | 1-0-1 | 1-0-2 | 1-0-3 | 1-1-0 |1-1-1 | 1-1-2 | 1-1-3 | 1-2-0 | 1-2-1 | 1-2-2 | 1-2-3 | ---------------------------------------------------------------------------------------------- 2-0-0 | 2-0-1 | 2-0-2 | 2-0-3 | 2-1-0 | 2-1-1 | 2-1-2 | 2-1-3 | 2-2-0 | 2-2-1 | 2-2-2 | 2-2-3 | ---------------------------------------------------------------------------------------------- 3-0-0 | 3-0-1 | 3-0-2 | 3-0-3 | 3-1-0 | 3-1-1 | 3-1-2 | 3-1-3 | 3-2-0 | 3-2-1 | 3-2-2 | 3-2-3 | ---------------------------------------------------------------------------------------------- 4-0-0 | 4-0-1 | 4-0-2 | 4-0-3 | 4-1-0 | 4-1-1 | 4-1-2 | 4-1-3 | 4-2-0 | 4-2-1 | 4-2-2 | 4-2-3 | ------------------------------------------------------------- 5-0-0 | 5-0-1 | 5-0-2 | 5-0-3 | 5-1-0 | 5-1-1 | 5-1-2 | 5-1-3 | ------------------------------------------------------------- 6-0-0 | 6-0-1 | 6-0-2 | 6-0-3 | 6-1-0 | 6-1-1 | 6-1-2 | 6-1-3 | ------------------------------------------------------------- 7-0-0 | 7-0-1 | 7-0-2 | 7-0-3 | 7-1-0 | 7-1-1 | 7-1-2 | 7-1-3 | ------------------------------------------------------------- 8-0-0 | 8-0-1 | 8-0-2 | 8-0-3 | 8-1-0 | 8-1-1 | 8-1-2 | 8-1-3 | ------------------------------ 9-0-0 | 9-0-1 | 9-0-2 | 9-0-3 | ------------------------------ 10-0-0 | 10-0-1 | 10-0-2 | 10-0-3 | ---------------------------------- 11-0-0 | 11-0-1 | 11-0-2 | 11-0-3 | ---------------------------------- 12-0-0 | 12-0-1 | 12-0-2 | 12-0-3 | Here is a sample of a TD including the image and other ID's: Code: <TD style=" border-bottom: 3px solid black;" class="gridoff" onMouseOver="className='gridon';" onMouseOut="className='gridoff';" id="gridtdD4C2"> <DIV align="center"> <IMG src="/testproject/n.gif" height="20" width="20" id="8-1-1" name="D4C2" onClick="flipBox(this);" class="gridbox"> </DIV> </TD> As you can see, the image ID is 8-1-1, which if you compare the two tables, is equal to D4C2. So far, everything is working perfect, as long as I have a grid that is 3x3x4, or, 3 squares across the top, 2 squares in the middles, and 1 square on the bottom, with 16 sub-squares in each. Now, the problem is, I do not always need a 3x3x4, sometimes I will need a 3x3x5, or a 4x4x4, or a 4x4x5 grid. I have made all the grids, and given them all the right ID's for both the TD, the IMG, as well as the <input> tags. When I test out a 3x3x5 grid, the first 4 columns in each square work fine, the 5th will only change to an X once, and cannot be changed again. Similarly, the first 4 rows in each square work, but not the 5th, with the same problem. Again, I have made sure that each of my ID's are correct, so that isn't the issue. The only thing I can figure it would be is the javascript. So, here it is, the script that does all the changes: Code: <SCRIPT LANGUAGE="JavaScript"> function checkDoubles(val) { // A4C5 = check A4C1, A4C2, A4C3, A4C4, A1C5, A2C5, A3C5, A5C5 var part1 = val.substr(0,1); var part2 = val.substr(1,1); var part3 = val.substr(2,1); var part4 = val.substr(3,1); var part12 = val.substr(0,2); var part34 = val.substr(2,2); var isdouble = "false"; // check A4C* for(i=1;i<5;i++) { var checkthisbox = part12 + part3 + i; if(checkthisbox!=val) { if(document.getElementById(checkthisbox).value==3) { alert("You can not set more than one box in any row to true at the same time! If you wish to set this box to true you must first remove the other true statement in this row."); var isdouble = "true"; } } } // check A*C5 for(i=1;i<5;i++) { var checkthisbox = part1 + i + part34; if(checkthisbox!=val) { if(document.getElementById(checkthisbox).value==3) { alert("You can not set more than one box in any column to true at the same time! If you wish to set this box to true you must first remove the other true statement in this column."); var isdouble = "true"; } } } return isdouble; } function flipBox(img) { var tmpname; if(img.src=="http://localhost/testproject/n.gif") { img.src = "http://localhost/testproject/x.gif"; tmpname = img.name; document.mainform.elements[tmpname].value = 1; document.getElementById(img.name).value = 1; } else if(img.src=="http://localhost/testproject/x.gif") { var finaltest = checkDoubles(img.name); if(finaltest=="false") { img.src = "http://localhost/testproject/o.gif"; tmpname = img.name; document.mainform.elements[tmpname].value = 3; document.getElementById(img.name).value = 3; } else { img.src = "http://localhost/testproject/n.gif"; } } else if(img.src=="http://localhost/testproject/o.gif") { img.src = "http://localhost/testproject/n.gif"; tmpname = img.name; document.mainform.elements[tmpname].value = 0; document.getElementById(img.name).value = 0; } showVals(); } </SCRIPT> I know nothing about javascript, so I have no idea why the grid is not working as it should. For some reason, 1-0-0 through 1-0-3 (A1B1 to A1B4) work, but 1-0-4 (A1B5) nor 5-0-4 (which would be A5B5 grid coord). It makes no sense to me. If you could please look over the script and tell me if you can see why it's letting the original part of the grid to work, but not the additional parts I add? Thank you! I'm in search for a simple and clean timed rotation script. I have these quotes, and right now they're coded so that a single quote displays and changes upon refresh. The script is really clean, and I would like to maintain the cleanliness but make the images rotate every couple of seconds. Here's the script... Code: <script type="text/javascript"> quote = new Array(3); quote[0] = "Quote 1"; quote[1] = "Quote 2"; quote[2] = "Quote 3"; index = Math.floor(Math.random() * quote.length); document.write(quote[index]); </script> It's probably a really simple piece of coding, but I'm still new to JavaScript, so it's obviously out of my range. I appreciate anyone who will help I'm looking to find a script... My client wants his users to be able to enter their zip code into a "check coverage area" text box. Then, on submit, it should return a message saying whether zip code is covered by his business. It seems like this would be a simple (ish) "if-else" script, listing the covered zip codes, but I'm not very experienced in javascript. Can anyone direct me to a free or cheap script that I could use and adapt for this? Thanks soooo much. I'm an artist working on a project that involves 9 swfs embedded in a html page and placed in tables. Although each swf has it's own volume control and pause/play buttons on mouseover, I need an outside script like java, that can be used to stop and start a few swf's simultaneously so that 3 or 4 play while the others are paused. There would be a few different combinations of them playing together that would be opted for by a menu choice. The swf's are in an old version of Macromedia Flash MX 6 using Action Script 2. I have absolutely no experience writing java scripting. None. I would be glad to pay somebody to write it for me. The page is online. If interested, I can forward the link. Thanks for your time. I use Firefox with Greasemonkey and a javascript that "keeps sorting in Y Fantasy Full games"... It stopped working this year and the site that I got it at (http://userscripts.org) has been down recently... I do not know javascript, so I have no idea where to begin... Any one have any idea what this isn't keeping the selected sort when one changes player types? Code: // ==UserScript== // @name Keep sorting in Y Fantasy Full Games // @namespace * // @description On the My Team Page, keeps the selected view when changing days, other stats. On the Player Search page, keeps the sort when changing player types. // @include http://*.fantasysports.yahoo.com/*/* // ==/UserScript== (function() { // my team age -- when changing dates, keep view loc_search=document.location.search; if(document.getElementById('datenav')){ datenav=document.getElementById('datenav'); links=datenav.getElementsByTagName('a'); loc_search=document.location.search; loc_search=loc_search.replace(/date=[\-0-9]*/,""); loc_search=loc_search.replace(/\?/,""); for (var i in links){ if(links[i].href){href=links[i].href; href=href.replace(/$/,loc_search); links[i].href=href; }} } loc_search=document.location.search; loc_search=loc_search.replace(/(status=\w*|pos=\w*|stat1=\w*|count=[0-9]*)/g,""); loc_search=loc_search.replace(/&&+/g,"&"); loc_search=loc_search.replace(/(^\?&|&$)/g,""); // Player search page. When changing stat filters, keep sort if(document.getElementById('statusselect')){ sel=document.getElementById('statusselect'); data=loc_search.split('&'); for (var i in data){ parts=data[i].split('='); ele=document.createElement( 'input' ); ele.type='hidden'; ele.name=parts[0]; ele.value=parts[1]; sel.parentNode.insertBefore(ele,sel); } } // back to my team page. if changing in subnav (ie, ave stats to stats, keep timeframe) if(document.getElementById('statnav')){ nav=document.getElementById('statnav'); links=nav.getElementsByTagName('a'); // GM_log(links.length); for (i in links){ if(links[i].href){href=links[i].href; if(! href.match(/stat2/) && ! href.match(/stat1=R/)){ //GM_log(href + links[i]); if(href.match(/stat1=A/)){loc_search=loc_search.replace(/stat2=L/,"stat2=AL")} if(href.match(/stat1=A/)){loc_search=loc_search.replace(/stat2=S/,"stat2=AS")} if(href.match(/stat1=S/)){loc_search=loc_search.replace(/stat2=AL/,"stat2=L")} if(href.match(/stat1=S/)){loc_search=loc_search.replace(/stat2=AS/,"stat2=S")} links[i].href=links[i].href+"&"+loc_search; }} } } })() Hello all, Firstly apologies for my javascript ignorance - I'm not a programmer, just someone thrust into programming since there's no-one else at my company who can do it. I found a nice js script online for a drop-down menu where the drop downs both expand to their full size and fade-in (very quickly) from transparent. The script in action can be seen on the script writer's site he http://sandbox.leigeber.com/dropdown-menu/index.html and the script is: Code: var menu=function(){ var t=15,z=50,s=6,a; function dd(n){this.n=n; this.h=[]; this.c=[]} dd.prototype.init=function(p,c){ a=c; var w=document.getElementById(p), s=w.getElementsByTagName('ul'), l=s.length, i=0; for(i;i<l;i++){ var h=s[i].parentNode; this.h[i]=h; this.c[i]=s[i]; h.onmouseover=new Function(this.n+'.st('+i+',true)'); h.onmouseout=new Function(this.n+'.st('+i+')'); } } dd.prototype.st=function(x,f){ var c=this.c[x], h=this.h[x], p=h.getElementsByTagName('a')[0]; clearInterval(c.t); c.style.overflow='hidden'; if(f){ p.className+=' '+a; if(!c.mh){c.style.display='block'; c.style.height=''; c.mh=c.offsetHeight; c.style.height=0} if(c.mh==c.offsetHeight){c.style.overflow='visible'} else{c.style.zIndex=z; z++; c.t=setInterval(function(){sl(c,1)},t)} }else{p.className=p.className.replace(a,''); c.t=setInterval(function(){sl(c,-1)},t)} } function sl(c,f){ var h=c.offsetHeight; if((h<=0&&f!=1)||(h>=c.mh&&f==1)){ if(f==1){c.style.filter=''; c.style.opacity=1; c.style.overflow='visible'} clearInterval(c.t); return } var d=(f==1)?Math.ceil((c.mh-h)/s):Math.ceil(h/s), o=h/c.mh; c.style.opacity=o; c.style.filter='alpha(opacity='+(o*100)+')'; c.style.height=h+(d*f)+'px' } return{dd:dd} }(); with Code: var menu=new menu.dd("menu"); menu.init("menu","menuhover"); used on my html page to call the script. I'm using the script exactly as written and exactly as it is on the dude's demo page for it. However, some of my sub-menu items are wider than their parent items and in IE7 this means they are bound to the width of the parent until the animations have finished, and then pop-out to their full width (NB not an issue in FF3). I'm actually not too fussed about either the fade in or expand out effects (they'd be nice, but not at the expense of the IE7 bug) so I simply wanted to know what I should do to the script to turn off the effects, or make them instant - ie reduce the length of the effect to as short as possible. I understand I can get rid of the bug by specifying a width for the ul element in my css, but I'd rather not do that if I can help it. I'd appreciate anyone's insight on this. Thanks Tom Hi Well, I am on a project. it's about quote of they but I need a hand (or some hands ) I've searched for what I need but I've got different results with GoOgle. The points a * It has to be more than for 365 days (for more than 3000 days!) * it has to be one by one (not random quote) * and it change every 24 hours without getting back for viewed quote(making mistake!) * finally, looping after viewing all quotes responses appreciated. +++ is it possible to scroll / jump to say, 10px above a div? i tried adding padding, but it doesn't work. also, when I use <a href="#xxxx">, is it possible to prevent the browser from adding #xxxx to the url in the browser? thanks!!! +++ Hello. I am in the process of making a basic game board using javascript. Just a table with a bunch of cells that are blank, soon to be colored. However, what I want to do is create my board and be able to scroll depending on where the mouse cursor is. For example, if it is 100px away from the right side of the screen, then move the board to the right. I am trying to use the information from: here I can't seem to get it to work. I have checked firebug, set and checked breakpoints, but it never moves and I am not sure why. Could anyone please help? Thank you. Heres my code: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <style> #land { table-layout: fixed; width: 2500px; height: 2500px; } #land td { width: 25px; height: 25px; border: 1px solid black; empty-cells:show; } #land tr { height: 25px; } </style> <script type="text/javascript" src="World/world.js"></script> <script type="text/javascript" src="mapscrolling.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body id="mainBody"> <div id="mainDiv"> </div> <script type="text/javascript" > new CursorDivScroll( 'mainDiv', 20, 20 ); // HERES THE REFERENCE! var i, j; body = document.getElementById("mainDiv"); land = document.createElement("table"); land.setAttribute("id", "land"); land.setAttribute("cellspacing", "0"); land.style.border = "1"; for(i = 0; i < 100; ++i) { var row = document.createElement("tr"); for(j = 0; j < 100; ++j) { var cell = document.createElement("td"); cell.appendChild(document.createElement("div")) // tried &nsbd; but didn't work row.appendChild(cell); } land.appendChild(row); } body.appendChild(land); </script> </body> </html> Hi there, I was wondering of there is any way to have a browser window scroll down when your mouse reaches the bottom of the page? Any help would be much appreciated, Thanks Hi, I'm looking to create a div which contains a list of news items which can be vertically scrolled through by hovering near the top or the bottom of the div. It will then automatically start scrolling through the content. The nearer to the bottom of the div they position their mouse, the faster the scrolling is. Is this something which is possible, and if so how can I do this? Thanks Curt I am looking to have a panoramic image used as the background webpage scroll automatically while the page is open. I do not want the user to have to scroll the image or hover over a div. Is there a way to accomplish this in JS?
|