JavaScript - Looking For Jquery Fullscreen Scroller
Hey fellow coders. I've been searching for a script, but I'm coming up empty. The script will display products in a single row full screen left to right. To slide the products there is a pull bar. You can see how the exact script works on http://www.logitech.com/en-us/keyboards/keyboards. Does anybody know of a complete script, or at least one that is close enough to alter. Thanks much.
Similar TutorialsHi All, I am trying to introduce a vertical scroller to my site, I got the code from a tutorial and slightly tweaked the html to meet my needs but now the content doesn't scroll. Would someone be willing to take a quick look and see if they can spot anything? None of this code has been altered! Code: <script type="text/javascript"> $(document).ready(function(){ $(".newsticker-jcarousellite").jCarouselLite({ vertical: true, hoverPause:true, visible:10, auto:500, speed:1000 }); }); </script> This is the HTML and PHP part: Code: <div id="newsticker-demo"> <div class="newsticker-jcarousellite"> <br/> <?php $query = mysql_query("SELECT * FROM employers WHERE featured = 'Yes' AND image != '' ORDER BY rand()"); $i=0; //$query = mysql_query("SELECT * FROM employers WHERE f_emp_active = 'Yes' and image !='' ORDER BY rand()"); echo '<div>'; while ($aqm=mysql_fetch_array($query)){ ?> <div> <div> <div class="thumbnail"> <div align="center"><a href="company.php?companyname=<?php echo $string ?>"> <img src="<?=$fullurl?>/thumbnail.php?gd=2&src=employers/logo/big/<?=$aqm[image]?>&maxw=<?=$a18[width]?>" alt="<?=$aqm[companyname]?>" title="<?=$aqm[companyname]?>" class="noborder" /></a> </div> </div> <div class="clear"></div> </div> </div> <br/> <br/> <?php if($i==5){ echo '</div><div>'; } $i++; } echo '</div>'; ?> </div> </div> Hi, does anyone know how to make a very simple jQuery vertical carousel? without having to use the plugin...
Hi all, I was following this tutorial for a jquery based scroller but I am having some problems: http://www.webdesignbooth.com/create...carousel-lite/ When it loads the block starts out as I want it then suddenly squeezes down and chops the text? The area in question is 'Featured Employers' http://www.beta.educationvacancies.com/index.php Can anyone advise? many thanks, greens85 Hey there! I'm having a bit of a problem with this site I'm workin' on... I am trying to incorporate a website slider (http://tympanus.net/codrops/2010/06/...g-with-jquery/), so when you click the links in my naviagtion, it slides right (horizontally) to a new page, however, with the slider/scroller script in there, the navigation stops working! Here is the link to this page and my code: http://goatsy.me/motoring/ Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="description" content="Website Horizontal Scrolling with jQuery" /> <meta name="keywords" content="jquery, horizontal, scrolling, scroll, smooth"/> <link rel="stylesheet" href="css/style.css" type="text/css" media="screen"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>High Style Motoring - Scooters, Pit Bikes, Atv's, Mopeds, Parts and more!</title> <link rel="stylesheet" href="example/css/website.css" type="text/css" media="screen"/> <!--[if lte IE 6]> <style type="text/css"> /* Internet Explorer 6 PNG transparency fix */ #rotatescroll .overlay { background: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="example/images/bg-rotatescroll.png", sizingmethod='scale'); } #rotatescroll .thumb { background: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="example/images/bg-thumb.png", sizingmethod='scale'); } </style> <![endif]--> <script type="text/javascript" src="example/js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="example/js/jquery.tinycircleslider.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#rotatescroll').tinycircleslider({ interval: true, snaptodots: true }); }); </script> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="description" content="Awesome Bubble Navigation with jQuery" /> <meta name="keywords" content="jquery, circular menu, navigation, round, bubble"/> <link rel="stylesheet" href="css/style.css" type="text/css" media="screen"/> <style> *{ margin:0; padding:0; } body{ font-family: "Trebuchet MS", sans-serif; background:#fff url(images/bg_scoot1.png) no-repeat top left; padding:20px; } .title{ width:548px; height:169px; position:absolute; top:300px; left:300px; background:transparent url(title.png) no-repeat top left; } a.back{ background:transparent url(back.png) no-repeat top left; position:fixed; width:150px; height:27px; outline:none; bottom:0px; left:0px; } #content{ margin:0 auto; } </style> </head> <body> <div id="wrap"> <div id="rotatescroll"> <div class="viewport"> <ul class="overview"> <li><a href="#"><img src="example/images/scoot_gray.png" /></a></li> <li><a href="#"><img src="example/images/scoot_red.png" /></a></li> <li><a href="#"><img src="example/images/scoot_green.png" /></a></li> <li><a href="#"><img src="example/images/scoot_atv.png" /></a></li> <li><a href="#"><img src="example/images/scoot_pit.png" /></a></li> </ul> </div> <div class="dot"></div> <div class="overlay"></div> <div class="thumb"></div> </div> <div id="content"> <a class="back" href="#"></a> <div class="title"></div> <div class="navigation" id="nav"> <div class="item user"> <img src="images/bg_user.png" alt="" width="199" height="199" class="circle"/> <a href="#" class="icon"></a> <h2>Home</h2> <ul class="nav"> <li><a href="#section1">About Us</a></li> <li><a href="#services">Services</a></li> <li><a href="#contact">Contact</a></li> </ul> </div> <div class="item home"> <img src="images/bg_home.png" alt="" width="199" height="199" class="circle"/> <a href="#" class="icon"></a> <h2>Bikes</h2> <ul> <li><a href="#scooter">Scooter</a></li> <li><a href="#moped">Moped</a></li> <li><a href="#atv">ATV / Pit</a></li> </ul> </div> <div class="item shop"> <img src="images/bg_shop.png" alt="" width="199" height="199" class="circle"/> <a href="#" class="icon"></a> <h2>Shop</h2> <ul> <li><a href="#">Catalog</a></li> <li><a href="#">Offers</a></li> <li><a href="#">Order Now</a></li> </ul> </div> <div class="item camera"> <img src="images/bg_camera.png" alt="" width="199" height="199" class="circle"/> <a href="#" class="icon"></a> <h2>Photos</h2> <ul> <li><a href="#">Bikes</a></li> <li><a href="#">Helmets</a></li> <li><a href="#">Acc.</a></li> </ul> </div> <div class="item fav"> <img src="images/bg_fav.png" alt="" width="199" height="199" class="circle"/> <a href="#" class="icon"></a> <h2>Extra</h2> <ul> <li><a href="#">Dream Bike</a></li> <li><a href="#">FAQ / Info</a></li> <li><a href="#">Comments</a></li> </ul> </div> </div> </div> <!-- The JavaScript --> <script type="text/javascript" src="jquery.easing.1.3.js"></script> <script type="text/javascript"> $(function() { $('#nav > div').hover( function () { var $this = $(this); $this.find('img').stop().animate({ 'width' :'199px', 'height' :'199px', 'top' :'-25px', 'left' :'-25px', 'opacity' :'1.0' },500,'easeOutBack',function(){ $(this).parent().find('ul').fadeIn(700); }); $this.find('a:first,h2').addClass('active'); }, function () { var $this = $(this); $this.find('ul').fadeOut(500); $this.find('img').stop().animate({ 'width' :'52px', 'height' :'52px', 'top' :'0px', 'left' :'0px', 'opacity' :'0.1' },5000,'easeOutBack'); $this.find('a:first,h2').removeClass('active'); } ); }); </script> <div class="section black" id="section1"> <h2>ABOUT US</h2> <p> HIGH STYLE MOTORING A constant commitment to quality, service, and customer satisfaction. We are a family owned and operated dealership doing business at our present location since 1987. It is important to note that we are a fully licensed and bonded California new motorcycle dealership (Dealer # 11080) and operating a full service brick and mortar establishment dedicated to serving the needs of the most discriminating customer. This is important as it sets us far apart from most of the "on-line" businesses that really don't have the proper knowledge or understanding of the products they sell. Here at HIGH STYLE MOTORING we are dedicated to not just the sale, but have a full service repair facility as well as one of the most extensive parts inventories available. Over the last 23 years we have helped literally thousands of customers find the Scooter, Pit Bike, ATV or vehicle that best fit their style and budget. We will be more than happy to help you as well! YIPPEE! Huge selection in stock and ready to take home. NATIONWIDE delivery is also available on each unit that we sell and you can rest assured knowing that your new vehicle will be delivered promptly right to your door ANYWHERE in the USA! It's for these reasons that we sell absolutely more Scooters, Pit Bikes, ATV's and other vehicles than ANYONE in the entire area! Check us out - we're here all day long saving you big $$$on the product that fits your style. Retro's, Cruisers, Freeway Scoots, ATV's and the complete line-up of SSR Pit Bikes are all in stock and ready for delivery - RIGHT NOW! We can also hand deliver your products anywhere in the Orange County or Los Angeles areas. Please give us a call at (562) 945-8361. We also accept most major credit cards. Stop by and say 'Hi' and let us help you to start saving money TODAY! </p> </div> <!-- The JavaScript --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="jquery.easing.1.3.js"></script> <script type="text/javascript"> $(function() { $('ul.nav a').bind('click',function(event){ var $anchor = $(this); /* if you want to use one of the easing effects: $('html, body').stop().animate({ scrollLeft: $($anchor.attr('href')).offset().left }, 1500,'easeInOutExpo'); */ $('html, body').stop().animate({ scrollLeft: $($anchor.attr('href')).offset().left }, 1000); event.preventDefault(); }); }); </script> </body> </html> And whenever I take out this part of the code, the navigation starts working again, but the slider totally doesn't work... it turns into a simple/regular page anchor again! D: (The slider doesn't seem to be working either way): Code: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> So, any ideas or info would be suuuuper appreciated b/c I've been trying to figure this out and I reallllllly want it to work! I can't seem to figure out what the problem is hurr! :\ Hi, well making a page fullscreen is one of my favorite topics but whenever I have thought of doing it, I have always received one answer and that is, it is only done with flash. For the first time today I saw one that is not done with flash, can someone tell me how exactly it is done, so I could atlast full my dream of using it ^^ here is the image http://content.screencast.com/users/...04-13_0001.png and here is the link to the page where this fullscreen button exists. http://tutorialzine.com/2010/09/html...deshow-jquery/ I need what this... Code: $('#gatewayDimmer').width($('html').width()); $('#gatewayDimmer').height($('html').height()); $('#gatewayDimmer').css('display','block'); ...is controlling to occupy the full screen/scrollable window. In FireFox, it does except for maybe...11px thats initially under the vertical scrollbar(when you use the horizontal scrollbar and scroll right, you can see the area under the vertical scrollbar was never occupied). In IE(7 at least), it occupies everything in the initial window, even the area underneath the vertical & horizontal scrollbars, but after scrolling down past the area the horizontal scrollbar would've covered, it doesn't occupy anything(it stops). I need every inch, pixel, etc. covered, from head to toe. To lock it, if you will. Is there something I can add, change here? Thanks in advance Hi, I've investigated contacting the author, but it doesn't look like I'll get a swift response. The script I'm using is hosted here The script is designed to create a fullscreen, scaling background that can be used as a carousel gallery for images, with a caption that floats next to the mouse pointer that either reads 'next' or 'previous'. It works fine but I am attempting to alter the script to do a few things: 1.Make the image take up a proportionate amount of window space - 85% (done) 2.Get rid of the text which appears on rollover(done) 3.Assign an image flip for the proportionally scaled image (this is the one I'm having problems with) I'm trying not to include too much information but it's hard to know where the problem is. I'm fairly sure this is used to set the scaler up on the page: Code: (function(){ var bg=document.getElementById('bg'),float=document.createElement('span'),scale=Scaler(bg); //Create and bind scaler-function addEvent=function(el,on,fn){el.attachEvent?el.attachEvent('on'+on,fn):el.addEventListener(on,fn,false)}, //Function for cross-borwser addEvent move=function(e){ float.style.left=(e=e||window.event).clientX+20+'px'; float.style.top=e.clientY+20+'px'; if(float.nxt!=(e.clientX>(document.body.offsetWidth/2)))float.innerHTML=(float.nxt=!float.nxt)?'':''; //Change html only if needed }, swap=function(e){ var key=(e=e||window.event).type=='MouseOver'?(e.clientX>(document.body.clientWidth/2)?40:37):e.keyCode; if(key>36&&key<41){ var data=scale(key>38?'+1':'-1'),l=data.els.length; for(var i=0;i<l;i++)data.els[i].style.height=i==data.to?'85%':'0px'; } } I've then used a simple imageflip function and implemented it here Code: addEvent(bg,'mouseout',function('BNB_mouseon()'){float.style.display='none'}); //Hide floater when not over image addEvent(bg,'mouseover',function('BNB_mouseon()'){float.style.display='block'}); Where 'bg' stands for the background image div. I've been scratching my head about this for quite a while now, so any advice is appreciated! I'm attempting to impliment it on the website http://www.freddydewemathews.com/, for a little context Found this random background img code that works great: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> <script type="text/javascript"> function changeImg(imgNumber) { var myImages = ["images/image0.jpg", "images/image1.jpg", "images/image2.jpg", "images/image3.jpg"]; var imgShown = document.body.style.backgroundImage; var newImgNumber =Math.floor(Math.random()*myImages.length); document.body.style.backgroundImage = 'url('+myImages[newImgNumber]+')'; } window.onload=changeImg; </script> <style type="text/css"> .bg {background-attachment:fixed; background-repeat: no-repeat; background-position:0% 0%;} </style> </head> <body class="bg"> <p>Some text</p> <!-- put a lot text lines here to see that the background stays fixed. --> <p>Some text</p> </body> The only problem i have is making the background image width and height 100% so that the entire image fills in the screen and fills in on resize of window. Please Help...thanks in advance i'm trying to get this effect http://css-tricks.com/3458-perfect-f...kground-image/ except, instead of using an image, i would like to use a javascript image gallery. I was playing around with smoothgallery2.0 but I don't really care which I use as long as I'm just displaying images (no text) and there is a smooth fade effect (since the images are pretty high res). thanks so much in advance! This is my first javascript game and it's pretty much built of code I've gathered over time and cleaned up. Here's a manipulated screenshot of what I'm trying to accomplish. You're an ant and you want those goodies on the map as quickly as possible! click this link to view a bigger manipulated screenshot click this link to view the goodies (items) The ant is the playable character you control by using the arrow keys. Every time you load the page, or click "restart game", three new items will spawn randomly on the level and the time will be reset to 0 seconds. An arrow key must be pressed to start the time counter and the game itself. There are only 5 items so far, cheese, apple, banana, candy and donut. The items are supposed to be collected as quickly as possible, when the last item has been collected (by simply running over it) the game will end, save the time and display a hi-score list. Time limit is 30 seconds, the game will display a classic "GAMER OVER" if the limit is overrided. Problems I'm trying to solve: 1: Fullscreen mode (and make the ant actually STAY on the screen) I want the game level to adapt itself to the computer screen. The game dimensions are 1000x600px at the moment but the ant does not respect the level dimensions. Screenshot: http://i41.tinypic.com/kc1j81.jpg. I have a feeling about that somekind of percental code has to be implented but I've never done this before. (Please note that the size of the ant and the items will remain as they are) 2: Spawning three items randomly on the level I drew 5 items and saved them as 100x100 PNG. Three of these items have to spawn at a random location on the fullscreen level. The LAST item collected must trigger the time counter to stop. The time will later be used on the hi-score list where he/she can type her nickname. This information will be uploaded to a database. 3: 30 second time limit Letting the time counter reach 30 seconds will trigger a "GAME OVER". The only way to try again is page refresh or "restart game". Code: <html> <head> <style type="text/css"> div#game { width:1000px; height:600px; position:absolute; background:#c3c3c3; } </style> <script type='text/javascript'> // movement vars var xpos = 100; var ypos = 100; var xspeed = 1; var yspeed =1; var maxSpeed = 5; // boundary var minx = 0; var miny = 0; var maxx = 1000; // characters movement field, width var maxy =600; // characters movement field, height // controller vars var upPressed = 0; var downPressed = 0; var leftPressed = 0; var rightPressed = 0; function slowDownX() { if (xspeed > 0) xspeed = xspeed - 1; if (xspeed < 0) xspeed = xspeed + 1; } function slowDownY() { if (yspeed > 0) yspeed = yspeed - 1; if (yspeed < 0) yspeed = yspeed + 1; } function gameLoop() { // change position based on speed xpos = Math.min(Math.max(xpos + xspeed,minx),maxx); ypos = Math.min(Math.max(ypos + yspeed,miny),maxy); // or, without boundaries: // xpos = xpos + xspeed; // ypos = ypos + yspeed; // change actual position document.getElementById('character').style.left = xpos + "px"; document.getElementById('character').style.top = ypos + "px"; // change speed based on keyboard events if (upPressed == 1) yspeed = Math.max(yspeed - 1,-1*maxSpeed); if (downPressed == 1) yspeed = Math.min(yspeed + 1,1*maxSpeed) if (rightPressed == 1) xspeed = Math.min(xspeed + 1,1*maxSpeed); if (leftPressed == 1) xspeed = Math.max(xspeed - 1,-1*maxSpeed); // deceleration if (upPressed == 0 && downPressed == 0) slowDownY(); if (leftPressed == 0 && rightPressed == 0) slowDownX(); // loop setTimeout("gameLoop()",10); } function keyDown(e) { var code = e.keyCode ? e.keyCode : e.which; if (code == 38) upPressed = 1; if (code == 40) downPressed = 1; if (code == 37) leftPressed = 1; if (code == 39) rightPressed = 1; } function keyUp(e) { var code = e.keyCode ? e.keyCode : e.which; if (code == 38) upPressed = 0; if (code == 40) downPressed = 0; if (code == 37) leftPressed = 0; if (code == 39) rightPressed = 0; } </script> </head> <body onload="gameLoop()" onkeydown="keyDown(event)" onkeyup="keyUp(event)" bgcolor='gray'> <!-- level --> <div id="game"></div> <!-- ant character --> <img id='character' src='images/ant.png' style='position:absolute;left:500px;top:500px;height:125px;width:200px;'/> </body> </html> I am using a Theme Tester on my site so normal users can not see the changes being made. If you can help me, please send me a PM & I will give you a temporary login so you can login & see the new site, and the issue I am having. Basically, I am trying to get this http://flowplayer.org/tools/demos/sc.../navigator.htm scroller to work, but it is not happening at all. Not sure what is going on. Please advise. Thanks! I've got a code. I've listed it below. The only question I have which I am sure I'm just overlooking it, but I need to find a way to squeeze this to the top of the screen and to the left. Where can I modify this on this code? The first section is the whole file. Thanks! Edit: I'm trying to remove the awkward gap on top and to the left. I merged the .js file since this will only be a file that is updated with new news. Code: <html> <head> <script type="text/javascript"> /* Text and/or Image Crawler Script v1.5 (c)2009-2011 John Davenport Scheuer as first seen in http://www.dynamicdrive.com/forums/ username: jscheuer1 - This Notice Must Remain for Legal Use updated: 4/2011 for random order option, more (see below) */ /* Update 4/2011 to v1.5 - Adds optional random property. Set it to true to use. Fixes browser crash from empty crawlers, ad and image blocking software/routines. Fixes behavior in some IE of breaking script if an image is missing. Adds alt attributes to images without them to aid in diagnosis of missing/corrupt images. This may be disabled with the new optional noAddedAlt property set to true. Internal workings enhanced for greater speed of execution, less memory usage. */ ///////////////// No Need to Edit - Configuration is Done in the On Page Call(s) ///////////////// function marqueeInit(config){ if(!document.createElement) return; marqueeInit.ar.push(config); marqueeInit.run(config.uniqueid); } (function(){ if(!document.createElement) return; marqueeInit.ar = []; document.write('<style type="text/css">.marquee{white-space:nowrap;overflow:hidden;visibility:hidden;}' + '#marq_kill_marg_bord{border:none!important;margin:0!important;}<\/style>'); var c = 0, tTRE = [/^\s*$/, /^\s*/, /\s*$/, /[^\/]+$/], req1 = {'position': 'relative', 'overflow': 'hidden'}, defaultconfig = { style: { //default style object for marquee containers without configured style 'margin': '0 auto' }, direction: 'left', inc: 2, //default speed - pixel increment for each iteration of a marquee's movement mouse: 'pause' //default mouseover behavior ('pause' 'cursor driven' or false) }, dash, ie = false, oldie = 0, ie5 = false, iever = 0; /*@cc_on @*/ /*@if(@_jscript_version >= 5) ie = true; try{document.documentMode = 2000}catch(e){}; iever = Math.min(document.documentMode, navigator.appVersion.replace(/^.*MSIE (\d+\.\d+).*$/, '$1')); if(iever < 6) oldie = 1; if(iever < 5.5){ Array.prototype.push = function(el){this[this.length] = el;}; ie5 = true; dash = /(-(.))/; String.prototype.encamel = function(s, m){ s = this; while((m = dash.exec(s))) s = s.replace(m[1], m[2].toUpperCase()); return s; }; } @end @*/ if(!ie5){ dash = /-(.)/g; function toHump(a, b){return b.toUpperCase();}; String.prototype.encamel = function(){return this.replace(dash, toHump);}; } if(ie && iever < 8){ marqueeInit.table = []; window.attachEvent('onload', function(){ marqueeInit.OK = true; for(var i = 0; i < marqueeInit.table.length; ++i) marqueeInit.run(marqueeInit.table[i]); }); } function intable(el){ while((el = el.parentNode)) if(el.tagName && el.tagName.toLowerCase() === 'table') return true; return false; }; marqueeInit.run = function(id){ if(ie && !marqueeInit.OK && iever < 8 && intable(document.getElementById(id))){ marqueeInit.table.push(id); return; } if(!document.getElementById(id)) setTimeout(function(){marqueeInit.run(id);}, 300); else new Marq(c++, document.getElementById(id)); } function trimTags(tag){ var r = [], i = 0, e; while((e = tag.firstChild) && e.nodeType === 3 && tTRE[0].test(e.nodeValue)) tag.removeChild(e); while((e = tag.lastChild) && e.nodeType === 3 && tTRE[0].test(e.nodeValue)) tag.removeChild(e); if((e = tag.firstChild) && e.nodeType === 3) e.nodeValue = e.nodeValue.replace(tTRE[1], ''); if((e = tag.lastChild) && e.nodeType === 3) e.nodeValue = e.nodeValue.replace(tTRE[2], ''); while((e = tag.firstChild)) r[i++] = tag.removeChild(e); return r; } function randthem(tag){ var els = oldie? tag.all : tag.getElementsByTagName('*'), i = els.length - 1, childels = [], newels = []; for (i; i > -1; --i){ if(els[i].parentNode === tag){ childels.push(els[i]); newels.push(els[i].cloneNode(true)); } } newels.sort(function(){return 0.5 - Math.random();}); i = childels.length - 1; for (i; i > -1; --i){ tag.replaceChild(newels[i], childels[i]); } } function Marq(c, tag){ var p, u, s, a, ims, ic, i, marqContent, cObj = this; this.mq = marqueeInit.ar[c]; if(this.mq.random){ randthem(tag); } for (p in defaultconfig) if((this.mq.hasOwnProperty && !this.mq.hasOwnProperty(p)) || (!this.mq.hasOwnProperty && !this.mq[p])) this.mq[p] = defaultconfig[p]; this.mq.style.width = !this.mq.style.width || isNaN(parseInt(this.mq.style.width))? '100%' : this.mq.style.width; if(!tag.getElementsByTagName('img')[0]) this.mq.style.height = !this.mq.style.height || isNaN(parseInt(this.mq.style.height))? tag.offsetHeight + 3 + 'px' : this.mq.style.height; else this.mq.style.height = !this.mq.style.height || isNaN(parseInt(this.mq.style.height))? 'auto' : this.mq.style.height; u = this.mq.style.width.split(/\d/); this.cw = this.mq.style.width? [parseInt(this.mq.style.width), u[u.length - 1]] : ['a']; marqContent = trimTags(tag); tag.className = tag.id = ''; tag.removeAttribute('class', 0); tag.removeAttribute('id', 0); if(ie) tag.removeAttribute('className', 0); tag.appendChild(tag.cloneNode(false)); tag.className = ['marquee', c].join(''); tag.style.overflow = 'hidden'; this.c = tag.firstChild; this.c.appendChild(this.c.cloneNode(false)); this.c.style.visibility = 'hidden'; a = [[req1, this.c.style], [this.mq.style, this.c.style]]; for (i = a.length - 1; i > -1; --i) for (p in a[i][0]) if((a[i][0].hasOwnProperty && a[i][0].hasOwnProperty(p)) || (!a[i][0].hasOwnProperty)) a[i][1][p.encamel()] = a[i][0][p]; this.m = this.c.firstChild; if(this.mq.mouse === 'pause'){ this.c.onmouseover = function(){cObj.mq.stopped = true;}; this.c.onmouseout = function(){cObj.mq.stopped = false;}; } this.m.style.position = 'absolute'; this.m.style.left = '-10000000px'; this.m.style.whiteSpace = 'nowrap'; if(ie5) this.c.firstChild.appendChild((this.m = document.createElement('nobr'))); if(!this.mq.noAddedSpace) this.m.appendChild(document.createTextNode('\xa0')); for(i = 0; marqContent[i]; ++i) this.m.appendChild(marqContent[i]); if(ie5) this.m = this.c.firstChild; ims = this.m.getElementsByTagName('img'); if(ims.length){ for(ic = 0, i = 0; i < ims.length; ++i){ ims[i].style.display = 'inline'; if(!ims[i].alt && !this.mq.noAddedAlt){ ims[i].alt = (tTRE[3].exec(ims[i].src)) || ('Image #' + [i + 1]); if(!ims[i].title){ims[i].title = '';} } ims[i].style.display = 'inline'; ims[i].style.verticalAlign = ims[i].style.verticalAlign || 'top'; if(typeof ims[i].complete === 'boolean' && ims[i].complete) ic++; else { ims[i].onload = ims[i].onerror = function(){ if(++ic === ims.length) cObj.setup(c); }; } if(ic === ims.length) this.setup(c); } } else this.setup(c) } Marq.prototype.setup = function(c){ if(this.mq.setup) return; this.mq.setup = this; var s, w, cObj = this, exit = 10000; if(this.c.style.height === 'auto') this.c.style.height = this.m.offsetHeight + 4 + 'px'; this.c.appendChild(this.m.cloneNode(true)); this.m = [this.m, this.m.nextSibling]; if(this.mq.mouse === 'cursor driven'){ this.r = this.mq.neutral || 16; this.sinc = this.mq.inc; this.c.onmousemove = function(e){cObj.mq.stopped = false; cObj.directspeed(e)}; if(this.mq.moveatleast){ this.mq.inc = this.mq.moveatleast; if(this.mq.savedirection){ if(this.mq.savedirection === 'reverse'){ this.c.onmouseout = function(e){ if(cObj.contains(e)) return; cObj.mq.inc = cObj.mq.moveatleast; cObj.mq.direction = cObj.mq.direction === 'right'? 'left' : 'right';}; } else { this.mq.savedirection = this.mq.direction; this.c.onmouseout = function(e){ if(cObj.contains(e)) return; cObj.mq.inc = cObj.mq.moveatleast; cObj.mq.direction = cObj.mq.savedirection;}; } } else this.c.onmouseout = function(e){if(!cObj.contains(e)) cObj.mq.inc = cObj.mq.moveatleast;}; } else this.c.onmouseout = function(e){if(!cObj.contains(e)) cObj.slowdeath();}; } this.w = this.m[0].offsetWidth; this.m[0].style.left = 0; this.c.id = 'marq_kill_marg_bord'; this.m[0].style.top = this.m[1].style.top = Math.floor((this.c.offsetHeight - this.m[0].offsetHeight) / 2 - oldie) + 'px'; this.c.id = ''; this.c.removeAttribute('id', 0); this.m[1].style.left = this.w + 'px'; s = this.mq.moveatleast? Math.max(this.mq.moveatleast, this.sinc) : (this.sinc || this.mq.inc); while(this.c.offsetWidth > this.w - s && --exit){ w = isNaN(this.cw[0])? this.w - s : --this.cw[0]; if(w < 1 || this.w < Math.max(1, s)){break;} this.c.style.width = isNaN(this.cw[0])? this.w - s + 'px' : --this.cw[0] + this.cw[1]; } this.c.style.visibility = 'visible'; this.runit(); } Marq.prototype.slowdeath = function(){ var cObj = this; if(this.mq.inc){ this.mq.inc -= 1; this.timer = setTimeout(function(){cObj.slowdeath();}, 100); } } Marq.prototype.runit = function(){ var cObj = this, d = this.mq.direction === 'right'? 1 : -1; if(this.mq.stopped || this.mq.stopMarquee){ setTimeout(function(){cObj.runit();}, 300); return; } if(this.mq.mouse != 'cursor driven') this.mq.inc = Math.max(1, this.mq.inc); if(d * parseInt(this.m[0].style.left) >= this.w) this.m[0].style.left = parseInt(this.m[1].style.left) - d * this.w + 'px'; if(d * parseInt(this.m[1].style.left) >= this.w) this.m[1].style.left = parseInt(this.m[0].style.left) - d * this.w + 'px'; this.m[0].style.left = parseInt(this.m[0].style.left) + d * this.mq.inc + 'px'; this.m[1].style.left = parseInt(this.m[1].style.left) + d * this.mq.inc + 'px'; setTimeout(function(){cObj.runit();}, 30 + (this.mq.addDelay || 0)); } Marq.prototype.directspeed = function(e){ e = e || window.event; if(this.timer) clearTimeout(this.timer); var c = this.c, w = c.offsetWidth, l = c.offsetLeft, mp = (typeof e.pageX === 'number'? e.pageX : e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft) - l, lb = (w - this.r) / 2, rb = (w + this.r) / 2; while((c = c.offsetParent)) mp -= c.offsetLeft; this.mq.direction = mp > rb? 'left' : 'right'; this.mq.inc = Math.round((mp > rb? (mp - rb) : mp < lb? (lb - mp) : 0) / lb * this.sinc); } Marq.prototype.contains = function(e){ if(e && e.relatedTarget){var c = e.relatedTarget; if(c === this.c) return true; while ((c = c.parentNode)) if(c === this.c) return true;} return false; } function resize(){ for(var s, w, m, i = 0; i < marqueeInit.ar.length; ++i){ if(marqueeInit.ar[i] && marqueeInit.ar[i].setup){ m = marqueeInit.ar[i].setup; s = m.mq.moveatleast? Math.max(m.mq.moveatleast, m.sinc) : (m.sinc || m.mq.inc); m.c.style.width = m.mq.style.width; m.cw[0] = m.cw.length > 1? parseInt(m.mq.style.width) : 'a'; while(m.c.offsetWidth > m.w - s){ w = isNaN(m.cw[0])? m.w - s : --m.cw[0]; if(w < 1){break;} m.c.style.width = isNaN(m.cw[0])? m.w - s + 'px' : --m.cw[0] + m.cw[1]; } } } } if (window.addEventListener) window.addEventListener('resize', resize, false); else if (window.attachEvent) window.attachEvent('onresize', resize); })(); /* Text and/or Image Crawler Script v1.5 (c)2009-2011 John Davenport Scheuer as first seen in http://www.dynamicdrive.com/forums/ username: jscheuer1 - This Notice Must Remain for Legal Use updated: 4/2011 for random order option, more (see below) */ </script> </head> <body> <font color="white" face="arial" size="2" background="#0066CC"> <div class="marquee" id="mycrawler" align="left"> 2/21/12 Today is testing the marquee. This will be used for announcements. Stay tuned!!!                         </div></font> <script type="text/javascript"> marqueeInit({ uniqueid: 'mycrawler', style: { 'padding': '1px', 'width': '1000px', //change to 1000 for normal, change to 0 for off 'background': '#0066CC', 'border': '0px solid black' }, inc: 1, //speed - pixel increment for each iteration of this marquee's movement mouse: 'false', //mouseover behavior ('pause' 'cursor driven' or false) moveatleast: 1, neutral: 150, savedirection: true }); </script> </body> </html> Hi I have a javascript scroller on my site which was added automatically by the web design progam Web Page Maker. It works well..... but..... does anybody know how to make the scrolling faster on mousedown. Its painfully slow at the moment. I dont know ANYTHING about javascripting really. heres the code: <div id="g_iFrame1div" style="position:absolute; left:68px; top:273px; z-index:29"> <table border="0" cellpadding="0" cellspacing="0" width=628> <tr><td> <iframe src="iframes/news_latest.htm" name="g_iFrame1" width="606" height="487" src="" scrolling="no" frameborder="0"></iframe> </td><td align="center" valign="middle" width="22"><img src="arrow_up.gif" alt="up" border=0 vspace="5" hspace="3" onMouseDown="esh_g_iFrame1();bsh_g_iFrame1(-3,2)" onMouseUp="esh_g_iFrame1();bsh_g_iFrame1(-1,20)" onMouseOver="bsh_g_iFrame1(-1,20)" onMouseOut="esh_g_iFrame1()"><br> <img src="arrow_down.gif" alt="down" border=0 vspace="5" hspace="3" onMouseDown="esh_g_iFrame1();bsh_g_iFrame1(3,2)" onMouseUp="esh_g_iFrame1();bsh_g_iFrame1(1,20)" onMouseOver="bsh_g_iFrame1(1,20)" onMouseOut="esh_g_iFrame1()"> <script type="text/javascript" language="javascript"> function bsh_g_iFrame1(step,time){hs_g_iFrame1=setInterval("sh_g_iFrame1("+step+")",time)} function esh_g_iFrame1(){clearInterval(hs_g_iFrame1)} function sh_g_iFrame1(step) { scrollx=g_iFrame1.document.body.scrollLeft scrolly=g_iFrame1.document.body.scrollTop scrolly=scrolly+step g_iFrame1.window.scroll(scrollx,scrolly) } </script> thanks Stuey Would anyone know why (and the fix) when I place my cursor over the scrolling thumbnails under the main slideshow rotator on my site they "disappear"? http://americanwebmakers.com/demo_college Thanks in advance! Does anyone have a scroller that goes side to side, to display links for a website? I have a similar thing that goes up and down: www.sjwum.org This one will not adapt to side to side. So who knows of a scroller that moves horizontally and when you click on something it is a link to another page on the website? Thanks I need to make a very simple text scroller (either vertical or horizontal) using JavaScript. Can anyone point me in the right direction? Thank you Hello, i'm trying to post news on my site. so i was able to reached this http://www.shmtestforums.uphero.com/...ller/test.html but i couldn't get, exactly what i want. i really want is when load the page it should shows only 3 rows then after few seconds(say 2 seconds), the 1st row should disappear and bellow 3 rows should come up (eg. when google_1 row is disappear, google_2 & google_3 & google_4 rows should come up) this rotation should be continuous i tried this many. but no positive result. so please.... please....help me to solve this. this is the problematic java script, Code: <script type="text/javascript"> var scrollspeed=cache=1 var initialdelay=500 function initializeScroller(){ dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer") dataobj.style.top="5px" setTimeout("getdataheight()", initialdelay) } function getdataheight(){ thelength=dataobj.offsetHeight if (thelength==0) setTimeout("getdataheight()",10) else scrollDiv() } function scrollDiv(){ dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px" if (parseInt(dataobj.style.top)<thelength*(-1)) dataobj.style.top="5px" setTimeout("scrollDiv()",40) } if (window.addEventListener) window.addEventListener("load", initializeScroller, false) else if (window.attachEvent) window.attachEvent("onload", initializeScroller) else window.onload=initializeScroller </script> thank you . I can't seem to find what I need but I know it exists. I trying to find a vertical scroller that will automatically have the text scroll upwards but have an arrow above and arrow below to be able to control the direction of the scrolling text, or a script with no arrows but still allow me to take control by mousing over the text to scroll up or down. Thanks Is there a way to bounce my image scroller back to the left using object.watch() or something?! at the moment, it reaches the end and stops here is my code from www.dyn-web.com Code: /************************************************************************* This code is from Dynamic Web Coding at www.dyn-web.com Copyright 2001-4 by Sharon Paine See Terms of Use at www.dyn-web.com/bus/terms.html regarding conditions under which you may use this code. This notice must be retained in the code as is! *************************************************************************/ /* dw_hoverscroll.js version date: June 2004 mouseover scrolling for dw_scrollObj (in dw_scrollObj.js) */ dw_scrollObj.stopScroll = function(wnId) { if ( dw_scrollObjs[wnId] ) dw_scrollObjs[wnId].endScroll(); } // increase speed onmousedown of scroll links dw_scrollObj.doubleSpeed = function(wnId) { if ( dw_scrollObjs[wnId] ) dw_scrollObjs[wnId].speed *= 2; } dw_scrollObj.resetSpeed = function(wnId) { if ( dw_scrollObjs[wnId] ) dw_scrollObjs[wnId].speed /= 2; } // algorithms for time-based scrolling and scrolling onmouseover at any angle adapted from youngpup.net dw_scrollObj.initScroll = function(wnId, deg, sp) { if ( dw_scrollObjs[wnId] ) { var cosine, sine; if (typeof deg == "string") { switch (deg) { case "up" : deg = 90; break; case "down" : deg = 270; break; case "left" : deg = 180; break; case "right" : deg = 0; break; default: alert("Direction of scroll in mouseover scroll links should be 'up', 'down', 'left', 'right' or number: 0 to 360."); } } deg = deg % 360; if (deg % 90 == 0) { cosine = (deg == 0)? -1: (deg == 180)? 1: 0; sine = (deg == 90)? 1: (deg == 270)? -1: 0; } else { var angle = deg * Math.PI/180; cosine = -Math.cos(angle); sine = Math.sin(angle); } dw_scrollObjs[wnId].fx = cosine / ( Math.abs(cosine) + Math.abs(sine) ); dw_scrollObjs[wnId].fy = sine / ( Math.abs(cosine) + Math.abs(sine) ); dw_scrollObjs[wnId].endX = (deg == 90 || deg == 270)? dw_scrollObjs[wnId].x: (deg < 90 || deg > 270)? -dw_scrollObjs[wnId].maxX: 0; dw_scrollObjs[wnId].endY = (deg == 0 || deg == 180)? dw_scrollObjs[wnId].y: (deg < 180)? 0: -dw_scrollObjs[wnId].maxY; dw_scrollObjs[wnId].startScroll(sp); } } // speed (optional) to override default speed (set in dw_scrollObj.speed) dw_scrollObj.prototype.startScroll = function(speed) { if (!this.ready) return; if (this.timerId) clearInterval(this.timerId); this.speed = speed || dw_scrollObj.speed; this.lyr = document.getElementById(this.lyrId); this.lastTime = ( new Date() ).getTime(); this.on_scroll_start(); this.timerId = setInterval(this.animString + ".scroll()", 10); } dw_scrollObj.prototype.scroll = function() { var now = ( new Date() ).getTime(); var d = (now - this.lastTime)/1000 * this.speed; if (d > 0) { var x = this.x + this.fx * d; var y = this.y + this.fy * d; if (this.fx == 0 || this.fy == 0) { // for horizontal or vertical scrolling if ( ( this.fx == -1 && x > -this.maxX ) || ( this.fx == 1 && x < 0 ) || ( this.fy == -1 && y > -this.maxY ) || ( this.fy == 1 && y < 0 ) ) { this.lastTime = now; this.shiftTo(this.lyr, x, y); this.on_scroll(x, y); } else { clearInterval(this.timerId); this.timerId = 0; this.shiftTo(this.lyr, this.endX, this.endY); this.on_scroll_end(this.endX, this.endY); } } else { // for scrolling at an angle (stop when reach end on one axis) if ( ( this.fx < 0 && x >= -this.maxX && this.fy < 0 && y >= -this.maxY ) || ( this.fx > 0 && x <= 0 && this.fy > 0 && y <= 0 ) || ( this.fx < 0 && x >= -this.maxX && this.fy > 0 && y <= 0 ) || ( this.fx > 0 && x <= 0 && this.fy < 0 && y >= -this.maxY ) ) { this.lastTime = now; this.shiftTo(this.lyr, x, y); this.on_scroll(x, y); } else { clearInterval(this.timerId); this.timerId = 0; this.on_scroll_end(this.x, this.y); } } } } dw_scrollObj.prototype.endScroll = function() { if (!this.ready) return; if (this.timerId) clearInterval(this.timerId); this.timerId = 0; this.lyr = null; } dw_scrollObj.prototype.on_scroll = function() {} dw_scrollObj.prototype.on_scroll_start = function() {} dw_scrollObj.prototype.on_scroll_end = function() {} |