JavaScript - Scrolling Graphics
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. Similar TutorialsFolks, I have been in IT for many years, but completely new to javascripting and ajax etc. I develop web sites and the php, html coding etc is no issue, its just that I have never needed to do any javascript coding and therefore have not used it at all. Picking it up should present little problem, but as of this moment, I am a complete tyro, and I need to get moving on this requirement ASAP. I have a requirement which I haver never before needed to address. I would be grateful for some pointers to resources (I have searched and searched..... ) which I could use to develop the functionality I need. After that rambling intro, here is the actual issue..... I need to have a variety of areas on a single picture on the website, each of which if clicked on, will go to a different article. Rather than try to explain, here is a link which does a similar thing, although this one is in Flash (which I also don't know): http://www.comcare.gov.au/virtual_wo...fice/reception I need to do pretty much the same thing, though with a different picture and words of course. The website will be a Joomla based site. I hope I have gived enough information, and indeed, hope that I have posted to the right area! Any assistance or thoughts at all would be greatly appreciated. regards to all, Mike I am looking to create a Stylesheet for YouTube, to make it look nicer and customise it completely I wanted to change the logo, but its a graphic. I was wondering if it would be possible to do this by linking to one hosted on Flickr? Or is there another trick? As it is, I'm using Walter Zorn's JS Graphics Library in an attempt to write a small screensaver-type-thing for jailbroken iPhones/iPod touches. However, on my mom's AMD Athlon 64 3000+, the drawing gets pretty laggy, so you can imagine how utterly choppy it is on my iPod. The look I'm going for is the Windows XP Mystify screen saver, with corners bouncing around the screen. So, my first question is this: are there any alternatives for this sort of thing, short of manually generating a video, gif, or multiple images to switch through, or is there any way to make my code more efficient for the CPU? (Code below) NOTE: I know I could make it look a lot nicer by making a 'corner' class, and having each corner be an object (and even nicer by using an array of 'corners'). But I'm not sure that would help the CPU's calculations much, and make the code more efficient as a whole. Code: <div id="Mystify"> <script type="text/javascript"> var mystifyCanvas = new jsGraphics("Mystify"); var tetraCorner1x = Math.floor(Math.random()*300) + 5; var tetraCorner1y = Math.floor(Math.random()*460) + 5; var tetraCorner2x = Math.floor(Math.random()*300) + 5; var tetraCorner2y = Math.floor(Math.random()*460) + 5; var tetraCorner3x = Math.floor(Math.random()*300) + 5; var tetraCorner3y = Math.floor(Math.random()*460) + 5; var tetraCorner4x = Math.floor(Math.random()*300) + 5; var tetraCorner4y = Math.floor(Math.random()*460) + 5; go1x = true; go1y = false; go2x = true; go2y = true; go3x = false; go3y = true; go4x = false; go4y = false; function MystifyJavaScript() { mystifyCanvas.clear(); mystifyCanvas.setColor("#ff0000"); mystifyCanvas.setStroke(2); if (go1x) { tetraCorner1x++; if (tetraCorner1x > 315) { go1x = false } } else { tetraCorner1x--; if (tetraCorner1x < 5) { go1x = true } } if (go1y) { tetraCorner1y++; if (tetraCorner1y > 475) { go1y = false } } else { tetraCorner1y--; if (tetraCorner1y < 5) { go1y = true } } if (go2x) { tetraCorner2x++; if (tetraCorner2x > 315) { go2x = false } } else { tetraCorner2x--; if (tetraCorner2x < 5) { go2x = true } } if (go2y) { tetraCorner2y++; if (tetraCorner2y > 475) { go2y = false } } else { tetraCorner2y--; if (tetraCorner2y < 5) { go2y = true } } if (go3x) { tetraCorner3x++; if (tetraCorner3x > 315) { go3x = false } } else { tetraCorner3x--; if (tetraCorner3x < 5) { go3x = true } } if (go3y) { tetraCorner3y++; if (tetraCorner3y > 475) { go3y = false } } else { tetraCorner3y--; if (tetraCorner3y < 5) { go3y = true } } if (go4x) { tetraCorner4x++; if (tetraCorner4x > 315) { go4x = false } } else { tetraCorner4x--; if (tetraCorner4x < 5) { go4x = true } } if (go4y) { tetraCorner4y++; if (tetraCorner4y > 475) { go4y = false } } else { tetraCorner4y--; if (tetraCorner4y < 5) { go4y = true } } mystifyCanvas.drawLine(tetraCorner1x, tetraCorner1y, tetraCorner2x, tetraCorner2y); mystifyCanvas.drawLine(tetraCorner2x, tetraCorner2y, tetraCorner3x, tetraCorner3y); mystifyCanvas.drawLine(tetraCorner3x, tetraCorner3y, tetraCorner4x, tetraCorner4y); mystifyCanvas.drawLine(tetraCorner4x, tetraCorner4y, tetraCorner1x, tetraCorner1y); mystifyCanvas.paint(); window.setTimeout("MystifyJavaScript()", 10); } MystifyJavaScript(); </script> </div> Please keep in mind, there's a LOT of repeat code, so you only have to read any one part once. To test/see/use the code, you'll need to download wz_graphics.zip. Then download the attached txt file to the same directory as the unzipped wz_graphics, change it to .html instead of .txt, and open it. http://vietnamthereandback.com/mainpage.html The arrows next to the songs previews are randomly appearing/disappearing on page refresh. There are always 8 arrows, but each refresh shows the arrows in different places. This has really got me stumped. If anyone has any thoughts, I'd really appreciate hearing them. The basic button/arrow code is below. The only thing that changes in the MP3 file name. <code> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="30" height="30"> <PARAM NAME=movie VALUE="http://www.vietnamthereandback.com/Clips/audioplay.swf?file=http://www.vietnamthereandback.com/Clips/reflections.mp3&auto=no&sendstop=yes&repeat=1&buttondir=http://www.vietnamthereandback.com/Clips/buttons/negative_small&bgcolor=0xffffff&mode=playpause"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <embed src="http://www.vietnamthereandback.com/Clips/audioplay.swf?file=http://www.vietnamthereandback.com/Clips/reflections.mp3&auto=no&sendstop=yes&repeat=1&buttondir=http://www.vietnamthereandback.com/Clips/buttons/negative_small&bgcolor=0xffffff&mode=playpause" quality=high wmode=transparent width="30" height="30" align="" TYPE="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object> </code> +++ 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, 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 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 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? 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 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> 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 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] 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! 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! I need a marquee code that displays images in a continuous vertical cycle.
|