JavaScript - Scrolling Div
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 Similar TutorialsHi 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 +++ 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> 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?
Hi evey one I have a problem with javascript . For example I have a link , something like this :<a href="#" title="" class="rating like" onclick="MakeRequestpos()">hi!</a> When I click on it , the page will scroll up and it's bother me . for example , I scroll the page down and When I click on the link , it'll scroll up . How can I solve it ? thanks hey, basically, on my blog i have a "load more" button at the bottom which works great. it uses AJAX to pull in the additional content. now, i want to keep that button, but I also want it to automatically load this content when you scroll to the bottom of the page (endless scrolling - like you see on a lot of sites). so far this is my code. I'm really knew to jquery so I'm sure the problem is obvious to you guys, but please be kind haha. #article_wrapper contains all the blog posts. #loaded contains the new ones that are loaded in with AJAX. #older_posts is the load more button. #load_more is a div around the load more button. thanks! Code: $(window).scroll(function(){ if ($(window).scrollTop() == $(document).height() - $(window).height()){ $('#articles_wrapper').append("<div class='loaded'></div>"); $('div.loaded:last').load(url); var last = $('div.loaded:last ul'); if (last.is(':empty')) { $('#older_posts').remove(); } url="/ajax/content_load.php" + $('#older_posts').attr('href') + " #load_more"; $('#older_posts').load(url); return false; } }); Can anyone tell me Got any javascript that can support the effect of following link http://www.markinns.com/articles/ful...uee_on_twitter but i want vertical text ...this link is for holizontal I dont wnat to use marquee, because got limitation This is my first javascript code ever and I need a bit of help. :[ Also, forgive the goofy styling for the nested divs; I couldn't figure out how to get them to align horizontally without wrapping =\. Essentially, I want the links to gradually scroll the containing div to the specified element's position. I wrote this in a roundabout manner for the sake of learning but I'll clean it up once I can get the function to work which... simply will not. Help? Code: <html> <head><title></title> <script type="text/javascript" src="http://kwonnie.comxa.com/js/jquery-1.2.6.min.js"></script> <script type="text/javascript"> var i = scroll_clipper.pageXOffset; function moveToGreen() { while (i<slide2.offsetLeft) { i++; scroll_clipper.pageXOffset++; setTimeout('moveToGreen()',100); } } </script> </head> <body> <a href="javascript:moveToGreen()">Green</a> <div style="width: 600px; height: 250px; overflow-y: hidden; overflow-x: hidden;" id="scroll_clipper"> <div style="width: 600px; height: 250px; background: red; float: left;" id="slide1"></div> <div style="width: 600px; height: 250px; background: green; float: left; position: relative; top: -250px; left: 600px;" id="slide2"></div> </div> </body> </html> This is what i need to do: I have a single <DIV> </DIV> for rendering dynamic HTML content. it already has a scrollbar in it when it overflows with text. I want to be able to prevent the user from selecting text on the DIV, and at the same time, when they click on the DIV and drag the mouse up or down , the HTML document will be scrolled proportionally to the dragging. i would also like to Hide the Scrollbar (not disable it). any suggestions? I am creating a testimonials page on a customers site, and I am wanting it to be like a scrolling content. I have the border created, and I want to have text inside the border that will scroll sideways displaying a new one every 10 seconds or so, but having the ability to move between the content. Can anyone tell me what sort of script I should use? I've seen something like it before, but I've had a mind blank. I know it's some kind of Java scripting. Any ideas? Thanks in advance I need a marquee code that displays images in a continuous vertical cycle.
Hi, I have the following scrolling table where I do not want the table headers to scroll. I want only the data inside <td></td> to scroll. For some reason that is not happening. Can someone help ? Really appreciate that. Regards, sbguy [CODE] <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Page</title> <script type="text/javascript"> var div, scrollTop, scrollID, direction, imgDirection, scrollID1; window.onload = function() { div1 = document.getElementById("div1"); scrollTop = div1.scrollTop; }; function scrollOnImage() { if (imgDirection ==1 ) { if (scrollTop != 0) scrollTop--; } else if (imgDirection == 2) { if (scrollTop != (div1.scrollHeight - 300)) scrollTop++; } div1.scrollTop = scrollTop; scrollID1 = setTimeout("scrollOnImage()", 10); } </script> </head> <body> <br /> <div style="border: solid 1px red; float: left; height:300px; max-height:300px; width:200px; overflow: hidden;" > <table> <tr> <th style="height:20px;"><input type="image" src="images/LGbtn_off.png" alt="img1" onMouseOut="clearTimeout(scrollID1)" onMouseOver="imgDirection=1; scrollOnImage()" /></th> <th>1A</th> <th ><input type="image" src="images/RRbtn_off.png" alt="img2" onMouseOut="clearTimeout(scrollID1)" onMouseOver="imgDirection=2; scrollOnImage()" /></th> </tr> <tr> <td colspan="3" style="height:280px; max-height:280px;"> <div id="div1"> <ul id="ulR_1A" class="ulli"> <li><span class="li_head">PCode:</span> 1234</li> <li><span class="li_head">Product:</span> GX12x24 Medium Large 80</li> <li><span class="li_head">Qty:</span> 256</li> <li><span class="li_head">Batch No:</span> 01AC950</li> <li><span class="li_head">Manf Date:</span> 11/08/2012</li> <li><span class="li_head">SS Date:</span>11/07/2013</li> <li><span class="li_head">Total Pals:</span> 60</li> <li><span class="li_head">Pals Occupied:</span> 59</li> <li><span class="li_head">Bin Occupancy:</span> 89%</li> <li><span class="li_head">Trn No:</span> 1234567890</li> <li><span class="li_head">Bin Status:</span> Part Full</li> </ul> <ul id="ulR_1A" class="ulli"> <li><span class="li_head">PCode:</span> 1235</li> <li><span class="li_head">Product:</span> GX12x24 Medium Large 80</li> <li><span class="li_head">Qty:</span> 256</li> <li><span class="li_head">Batch No:</span> 01AC950</li> <li><span class="li_head">Manf Date:</span> 11/08/2012</li> <li><span class="li_head">SS Date:</span>11/07/2013</li> <li><span class="li_head">Total Pals:</span> 60</li> <li><span class="li_head">Pals Occupied:</span> 59</li> <li><span class="li_head">Bin Occupancy:</span> 89%</li> <li><span class="li_head">Trn No:</span> 1234567890</li> <li><span class="li_head">Bin Status:</span> Part Full</li> </ul> <ul id="ulR_1A" class="ulli"> <li><span class="li_head">PCode:</span> 1236</li> <li><span class="li_head">Product:</span> GX12x24 Medium Large 80</li> <li><span class="li_head">Qty:</span> 256</li> <li><span class="li_head">Batch No:</span> 01AC950</li> <li><span class="li_head">Manf Date:</span> 11/08/2012</li> <li><span class="li_head">SS Date:</span>11/07/2013</li> <li><span class="li_head">Total Pals:</span> 60</li> <li><span class="li_head">Pals Occupied:</span> 59</li> <li><span class="li_head">Bin Occupancy:</span> 89%</li> <li><span class="li_head">Trn No:</span> 1234567890</li> <li><span class="li_head">Bin Status:</span> Part Full</li> </ul> </div> </td> </tr> </table> </div> <div style="border: solid 1px red; float: left"> <img src="http://www.easyvoyage.co.uk/base/imgs/default/esv/meh/upDownArrow.png" onMouseOut="clearTimeout(scrollID1)" onMouseOver="imgDirection=1; scrollOnImage()" /><br /><br /> <img src="http://www.easyvoyage.co.uk/base/imgs/default/esv/meh/downUpArrow.png" onMouseOut="clearTimeout(scrollID1)" onMouseOver="imgDirection=2; scrollOnImage()" /> </div> </body> </html> [CODE] Hi, I know that iframes can be set to have scroll bars automatically apear when needed or put them there permanantly. However, I would like to have a Javascript slider on the topmost page scroll the iframe. It was possible to make a link on the topmost page change the content of the iframe by putting the iframe name in the link's target. Is this possible with a slider? I ask this because some of the content inside the iframe is on external pages so obviously we can't add the scroll bar there. I need help adding an auto scrolling feature (such as this http://www.brownielocks.com/autoscroll1.html) to an object on my website (see www.mymcgillmisa.com) I've tried (with no results) to get it to scroll, but maybe some experienced coders can help Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head><title></title></head><body><div style="width:320px; height:360px; overflow:auto;"> <p style="font: 13pt/20pt Garamond, Georgia, serif;color:#191919;"> <b> NEWS AND ANNOUNCEMENTS</b> </p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> <b>WELCOME BACK </b></p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> MISA has big plans for you this year, so stay tuned and check back here often. We plan on keeping you as up to date as possible with events relevant to you this year.</p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> <b>MISA Rep Selection 09</b></p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> <b>3</b> representatives will be chosen by the executive council for each year (U1, U2, & U3) , if you are interested in applying please check your McGill e-mail or <a href="http://www.sendspace.com/file/60yyn4">click here</a> for information.</p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> <b>Intramural Sports Teams</b></p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> The possible teams a Basketball, Ball Hockey, Dodgeball, Flag Football, Ice Hockey, Outdoor Soccer, Ultimate, & Volleyball. Teams will be formed based on the number of people interested. Please send an email from your McGill email to <a href="mailto:mimmsports@gmail.com">mimmsports@gmail.com</a> with a subject header of the sport (s) you wish to play. All requests must be sent in by Friday September 11th to be considered.</p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> <b>ROYAL FLUSH:</b></p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> Casino night fundraiser for the Crohn's and Colitis Foundation of Canada at Suco on St-Laurent on <b>Sept 11 @ 9PM </b> feat. DJ Alexei Sopin, Burlesque and Sexy Bollywood dancers, poker, blackjack, roulette, and prizes! Cocktail Dress Code. <a href="http://www.royalflush.yolasite.com">www.royalflush.yolasite.com</a> (20$)</p> </div></body></html> Any help would be appreciated thanks Hi! I'm trying to build a menu that works just like this one: http://deluxe-menu.com/ajax-technology-menu-sample.html The menu automatically scrolls when the menu doesn't fit the browser window. How is a menu that works like this built? Is there any free demos/examples? Thanks in advance! hey guys i have graphic on the right side of the screen that is not in view and i am scrolling it to the left. Is there away to remove the bottom scrollbar permanently through using a mask or something. if i have an item scrolling from the left the scroll bar does not show, but on the right it does. an help be appreciated. Hi, I need some help with getting the browser to automatically scroll to the top when the user slides horizontally. It's probably easier for you to see what I mean! http://www.zabirvalliji.co.uk This is my website (still a working progress!!). If you click the links you will see the website scrollings horizontally. If you scroll to the bottom of 'portfolio', and then click another section, you will see that the browser stays at the bottom. Basically, I want the browser to automatically slide to the top whenever the user goes to another section. Is anyone able to help me? Hi, I am having a problem with my dropdown menus as they continue to stick after they have returned. Here is the code, any help would be amazing. Code: var DDSPEED = 10; var DDTIMER = 15; function ddMenu(id,d){ var h = document.getElementById(id + '-ddheader'); var c = document.getElementById(id + '-ddcontent'); clearInterval(c.timer); if(d == 1){ clearTimeout(h.timer); if(c.maxh && c.maxh <= c.offsetHeight){return} else if(!c.maxh){ c.style.display = 'block'; c.style.height = 'auto'; c.maxh = c.offsetHeight; c.style.height = '0px'; } c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER); }else{ h.timer = setTimeout(function(){ddCollapse(c)},50); } } // collapse the menu // function ddCollapse(c){ c.timer = setInterval(function(){ddSlide(c,-1)},DDTIMER); } function cancelHide(id){ var h = document.getElementById(id + '-ddheader'); var c = document.getElementById(id + '-ddcontent'); clearTimeout(h.timer); clearInterval(c.timer); if(c.offsetHeight < c.maxh){ c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER); } } function ddSlide(c,d){ var currh = c.offsetHeight; var dist; if(d == 1){ dist = (Math.round((c.maxh - currh) / DDSPEED)); }else{ dist = (Math.round(currh / DDSPEED)); } if(dist <= 1 && d == 1){ dist = 1; } c.style.height = currh + (dist * d) + 'px'; c.style.filter = 'alpha(opacity=' + (currh * 100 / c.maxh) + ')'; if((currh < 2 && d != 1) || (currh > (c.maxh - 2) && d == 1)){ clearInterval(c.timer); } } Also, I have tried Code: window.onscroll = function onPagescroll() { var combo = $find('<%= RadComboBox1.ClientID %>'); combo.hideDropDown(); }; But obviously, to no avail. This problem occurs in all browsers. I am using this code to control scrolling of 2 divs at the same time, but i want to be able control 3 (or more) divs at the same time.. what am i missing? JS in head: <script type="text/javascript"> function scrollDiv(controllingElement, controlledElementID) { var controlledElement = document.getElementById(controlledElementID); controlledElement.scrollTop = controllingElement.scrollTop; controlledElement.scrollLeft = controllingElement.scrollLeft; } </script> JS in body applied to parent / controlling div: <div id="master" onscroll="scrollDiv(this,'top');" > ...</div> Names of the 2 divs controlled by "master": <div id="top" >...</div> <div id="bottom" >...</div> Hi - I don't know much about javascript, html, or web development. I have this javascript on my page (that is an iframe). <script type="text/javascript"> var site = 'http://' + 'localParameter("site_address")' <!-- window.location = site //--> </script> Note: site_address is a parameter that's passed to the page when loaded. Now, I need to make this iframe scroll down by like 50 pixels once the page is loaded. How can I do this? Thanks |