JavaScript - Auto Animate On Page Load
I want to design my website so that when a page loads javascript will smoothly animate it from a reference point to the top of the page. I visited an Apple store recently and was looking at the encased ipods next to the displayed product and the one next to the iphone has a mini site and after pressing the compare button at the bottom of the page I saw this animation. Below is a link to the video i recorded showing what I am trying to achieve. Any and all help will be appreciated. I have found other script that animate on page load but none of which does it from a reference point like the following video. I'm not sure how the page loads at that point either. If someone could help with that as well I would greatly appreciate it. Thanks in advance.
http://demetriusmcclain.elementfx.co...pageScroll.MOV Similar TutorialsHello, I don't know if this can be done in Javascript, or requires any other language but i was wondering if this would be possible. I would like to embed this Javascript code in to a PHP file and then for it to run automatically upon the PHP file loading: Code: <td class="smallDesc"> <a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> </td> The Javascirpt is the Facebook Share button that basically allows users that have Facebook to share the page there currently on in their Facebook status by pressing the button, but if there not logged in it shows the login page, not a problem just continue the script. The current button i which is what i want to load automatically in the PHP file is located here, to test the functionalilty just click "Share" button in blue.. http://watch-movies-online.anyfilman...-Movie-17.html To summarise, i would like the above Javascript code to execute automatically upon pageload of this PHP file.. http://www.watch-movies-online.anyfi...p://google.com. If that could be done, and if this also is possible.. i would like for the "Share" button on the external page that is loaded from the Javascript code above to be clicked automatically so in effect when ever someone visits the PHP page after clicking "Click Here to Watch/Stream 2012 Online For Free" on this page it will automatically load the Facebook Share box, and automatically click the "Share" Button and then close the page if possible, but not required. Please feel free to ask any questions, i'll be happy to answer. Thanks in advance. Best Regards, Jonathan. Hi, i been poken around on here and have not found anything on this as of now, so i thought i would ask. i have a table of data that is positioned in the middle of one of my pages, rather than change the layout i thought it would be nice to just have the page auto scroll down to the middle of the page when the page loads so that the user does not have to constantly scroll down.. i tried this and several versions of it with no luck.. Code: scrollWindow(); // scrolls the window to auto load in middle of page function scrollWindow() { window.scroll(0,450); } i also tried scrollBy, and still nothing i tried using the body onload and still nothing... the scroll bar does seem to flash down for a split sec and im wondering if im using the wrong javascript function or if i might have some css that is locking it to load top of page.. not sure what to look for in the css though.. is there a dif function to do this.. thanks Hey guys. I need a Javascript that clicks on particular co-ordinates on page load. I'll even make do with a script that clicks on a random co-ordinate on page load. Just a simple click has to be made automatically on page load on the page. I tried using and editing this code: Code: <html> <head> <script> window.onload = function(){ document.getElementById("autoid").click(); } </script> </head> <body> <a href="http://google.com" id="autoid">Search Engine</a> </body> </html> but its of no use because I want it to click on another javascript, thats another Code: <script type="text/javascript"> [Script data goes here that takes about 700 x 700 pixels on the screen] </script> I want a click to be made on this script somehow. I can add Code: window.setTimeout('clickit()',5000); function clickit(){ location.href = document.getElementById("autoid"); myself which will delay it so the click occurs after page load but I just want a click to happen on top of that javascript. Any help will be greatly appreciated. Cheers! Hi all Is there a way to get the image(s) to load into the table after the page has loaded instead of the way I have it now? I have 4 tabs, but I would like the imgs in tabs 2,3,4 to load after page load. Example of how the tabs look. Code: <div class="tabbertab"> <h2>Australia_____</h2> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFCC"> <caption class="highlight_Red">澳洲 Australia </caption> <tr> <td><a href="pages/promotion.html#aus_ACE" rel="nofollow" target="_blank"><img src="pages/images/Pics/AUS/ace.jpg" alt="ACE / ATTC" width="110" height="69" border="0" align="left" class="ozimg_L"/> ...a few more images etc the other tabs look the same. LT This script displays a link to a registration/login form that loads in a light box for Joomla. I've been goin nuts trying to figure out how to get this to load on page load with a delay. Anyone know how to get this done? PHP Code: <?php JHTML::_('behavior.mootools'); $document = JFactory::getDocument(); $document->addStyleSheet(JURI::base() . 'media/system/css/modal.css'); $document->addScript(JURI::base() . 'media/system/js/modal.js'); $document->addScriptDeclaration("window.addEvent('domready', function() {SqueezeBox.initialize({});});"); $user = & JFactory::getUser(); $uri = JFactory::getURI(); $url = $uri->toString(); $return = base64_encode($url); ?> <div id="lbframeid" style="position:absolute;top:1px;left:1px;height:0px;width:0px;overflow:hidden"> <a href="http://www.wowjoomla.com/"><h1>Joomla Login LightBox powered by WowJoomla.com</h1> </a> </div> <?php if ($user->get('guest')) :?> <a href="<?php echo JRoute::_('index.php?option=com_loginbox')?>" onclick="SqueezeBox.fromElement(this); return false;" rel="{handler: 'iframe', size: {x: 660, y: 500}}"><?php echo JText::_('SIGNUP_LOGIN')?></a> <?php else: ?> <?php echo JText::sprintf( 'HINAME', $user->get('name') ); ?> <br> <a href="javascript:void(0);" onclick="LB_onLogout(); return false;"><?php echo JText::_('LOGOUT')?></a> <?php endif; ?> <script type="text/javascript"> function LB_onLogout() { var form = new Element('form'); form.setProperty('method', 'POST'); form.setProperty('target', '_self'); form.setProperty('action', 'index.php'); var input = new Element('input'); input.setProperty('type', 'hidden'); input.setProperty('name', 'option'); input.setProperty('value', 'com_user'); form.appendChild(input); var input = new Element('input'); input.setProperty('type', 'hidden'); input.setProperty('name', 'task'); input.setProperty('value', 'logout'); form.appendChild(input); var input = new Element('input'); input.setProperty('type', 'hidden'); input.setProperty('name', 'return'); input.setProperty('value', '<?php echo $return; ?>'); form.appendChild(input); $E('body').appendChild(form); form.submit(); } </script> Hello. My goal is to load the JS for a specific element before displaying that element. I integrated a third part script, and it works well. I set the timer he The JS is in my heading as <script type="text/javascript" src="countdownpro.js"></script> About mid-body I have: <span id="countdown1">2010-07-20 00:00:00 GMT+00:00</span> which allows for the setting of a target date to countdown to. When the page first loads it shows the above long format target time, until the js/meta tags kick in to modify it to just show the actual countdown as 00:00:00. I have attached countdownpro.js to this post. I tried shifting the function CD_Init() to the top of the script, and also appended it inline with the .html. I tried setting the big external script to "defer", but neither arrangement worked. I also tried placing the src file right at the top. I appreciate your help. Hi All, Im new to this forum...need some of your help and advice. I have a js code like this : <script type="text/javascript"> <!-- var sipPos = 0; $(document).ready(function() { $("#panel-tab").click(function(e) { //if(autoTimer) clearTimeout(autoTimer); //autoTimer = null; e.preventDefault(); $("#panel").animate({ left: sipPos }, 1764, 'linear', function() { if(sipPos == 0) { sipPos = -856; } else { sipPos = 0; } }); }); }); --> </script> what it does is that it hide and show a panel by slidint it to the left. But my client want that on page load the panel opens automatically for about 2-3 seconds just to let users know that its here. So ive written this : <script type="text/javascript"> <!-- var sipPos = 0; $(document).ready(function() { var autoTimer = null; autoTimer = setTimeout(function(){ $("#panel").animate({ left: sipPos }); autoTimer = setTimeout(function(){ $("#panel").animate({ left: sipPos = -856 }); }, 2000); },1000); $("#panel-tab").click(function(e) { //if(autoTimer) clearTimeout(autoTimer); //autoTimer = null; e.preventDefault(); $("#panel").animate({ left: sipPos }, 1764, 'linear', function() { if(sipPos == 0) { sipPos = -856; } else { sipPos = 0; } }); }); }); --> </script> But when the panel finished showing the button to open it again doesn't work...any help please..really urgent. thks //Sam On this website... http://livedemo00.template-help.com/...21/index.html# When you click on the Navigation Bar the website pages load inside that page? How exactly would i go around doing this? Thankyou Hello Basically I have found and adapted the code: Code: alreadyloading = false; nextpage = 2; $(window).scroll(function() { if ($('body').height() <= ($(window).height() + $(window).scrollTop())) { if (alreadyloading == false) { var url = "page"+nextpage+".html"; alreadyloading = true; $.post(url, function(data) { $('#projectscontainer').children().last().after(data); alreadyloading = false; nextpage++; }); } } }); I want when the user scrolls to the bottom of the page for content in a new page to load under the div "#projectscontainer". So in the new page 'Page2.html" I have put 5 divs going down with content in... I want the new content to appear below "#projectscontainer'" Why won't this work? Anyone know? Thanks Hello Bit of a nightmare scenario but, the services page isn't loading and from what I can tell, IE 6,7 & 8 are throwing up the same error. It says: Line: 602 Char 5 Error: 'undefined' is null or not an object Code: 0 which refers to: vmlSegments.push('m'); if (glyph.o) { The page is here The script it is referring to is typeface.js: http://typeface.neocracy.org/ Hope someone can be a great help and tell me how I can get page loading again. All the other pages are fine. p.s. I'm not a coder but designer and hoping to get this fixed myself. Thank you. I have already worked on this pop-up: https://defencedog.googlecode.com/sv...lcome_box.html but I still considers a lightweight replacement so here it goes https://defencedog.googlecode.com/sv...elcome/my.html as you can see the popup show at click event; I want it to load automatically when page loads & can't find the appropriate method: Here my failed tries... Code: $(document).ready(function () { // id is the ID for the DIV you want to display it as modal window launchWindow( dialog ); //Get the screen height and width var maskHeight = $(document).height(); var maskWidth = $(window).width(); //Set heigth and width to mask to fill up the whole screen $('#mask').css({'width':maskWidth,'height':maskHeight}); //transition effect $('#mask').fadeIn(1000); $('#mask').fadeTo("slow",0.8); //Get the window height and width var winH = $(window).height(); var winW = $(window).width(); //Set the popup window to center $( dialog ).css('top', winH/2-$( dialog ).height()/2); $( dialog ).css('left', winW/2-$( dialog ).width()/2); //transition effect $( dialog ).fadeIn(2000); //if close button is clicked $('.window .close').click(function (e) { //Cancel the link behavior e.preventDefault(); $('#mask').hide(); $('.window').hide(); }); //if mask is clicked $('#mask').click(function () { $(this).hide(); $('.window').hide(); }); }); Hey every1. Im a web design student who is trying to make my first webpage for a school project. my problem: I have 2 javascripts i would like to run smooth on my page, but they wont. I have read the info about using the <body onload="dothis()"; "dothat()"> but my problem is the way the 1 javascript is made. i believe so that is. First script: A matrix look-a-like screen for a link. Code: <script type="text/javascript"> // <![CDATA[ var height=9; // height of the effect in rows - must be an odd number var speed=66; // lower is faster var reveal=99; // between 0 and 100 // the higher, the faster the word is 'decoded' var repeat=10; // if '0' the script does not repeat // if set to a number this is the delay until the script repeats var alink="http://www.noma.nu"; // place to link to // set to alink="" if not needed /***************************\ * The Matrix JavaScripted.. * *(c) 2003-6 mf2fm web-design* * http://www.mf2fm.com/rv * * DON'T EDIT BELOW THIS BOX * \***************************/ var timer, table, x, y, columns, ma_txt, ma_cho; reveal/=100; var m_coch=new Array(); var m_copo=new Array(); window.onload=function() This is part im having troubles with. If i do as your toturial tells me i should put Function() down in the body onload command. But it wont work. { if (document.getElementById) { var matrix, tbody, tr, td; matrix=document.getElementById("matrix"); ma_txt=matrix.firstChild.nodeValue; ma_txt=" "+ma_txt+" "; columns=ma_txt.length; while (matrix.childNodes.length) matrix.removeChild(matrix.childNodes[0]); table=document.createElement("table"); table.cellSpacing=0; table.style.margin="auto"; table.style.width="auto"; table.style.border="none"; tbody=document.createElement("tbody"); for (x=0; x<height; x++) { tr=document.createElement("tr"); for (y=0; y<columns; y++) { td=document.createElement("td"); td.className="matrix"; td.appendChild(document.createTextNode(String.fromCharCode(160))); tr.appendChild(td); } tbody.appendChild(tr); } table.appendChild(tbody); matrix.appendChild(table); ma_cho=ma_txt; for (x=0; x<columns; x++) { m_copo[x]=0; ma_cho+=String.fromCharCode(32+Math.floor(Math.random()*94)); } x=0; timer=setInterval("mytricks()", speed); }} function mytricks() { var mtmp, mrow; var z=x; x=0; for (y=0; y<columns; y++) { x=x+(m_copo[y]==100); mrow=m_copo[y]%100; if (mrow && m_copo[y]<100) { if (mrow<height+1) { mtmp=table.rows[mrow-1].cells[y]; mtmp.firstChild.nodeValue=m_coch[y]; mtmp.style.color="#33ff66"; mtmp.style.fontWeight="bold"; } if (mrow>1 && mrow<height+2) { mtmp=table.rows[mrow-2].cells[y]; mtmp.style.fontWeight="normal"; mtmp.style.color="#00ff00"; } if (mrow>2) table.rows[mrow-3].cells[y].style.color="#009900"; if (mrow<Math.floor(height/2)+1) m_copo[y]++; else if (mrow==Math.floor(height/2)+1 && m_coch[y]==ma_txt.charAt(y)) zoomer(y); else if (mrow<height+2) m_copo[y]++; else if (m_copo[y]<100) m_copo[y]=0; } else if (Math.random()>0.9 && m_copo[y]<100) { if (reveal>Math.random() && (z+1)/columns>Math.random()) m_coch[y]=ma_cho.charAt(y); else m_coch[y]=ma_cho.charAt(Math.floor(Math.random()*ma_cho.length)); m_copo[y]++; } } if (x==columns) { if (repeat) { ma_cho=ma_txt; for (x=0; x<columns; x++) { m_copo[x]=0; ma_cho+=String.fromCharCode(32+Math.floor(Math.random()*94)); } } else clearInterval(timer); } } function zoomer(ycol) { var mtmp, mtem, ytmp; if (m_copo[ycol]==Math.floor(height/2)+1) { for (ytmp=0; ytmp<height; ytmp++) { mtmp=table.rows[ytmp].cells[ycol]; mtmp.firstChild.nodeValue=m_coch[ycol]; mtmp.style.color="#33ff66"; mtmp.style.fontWeight="bold"; if (alink) { mtmp.style.cursor="pointer"; mtmp.onclick=function() {window.location.href=alink}; } } mtmp=ma_cho.indexOf(ma_txt.charAt(ycol)); m_copo[ycol]+=199; setTimeout("zoomer("+ycol+")", speed); } else if (m_copo[ycol]>200) { mtmp=table.rows[m_copo[ycol]-201].cells[ycol]; mtem=table.rows[200+height-m_copo[ycol]].cells[ycol]; m_copo[ycol]-=1; mtmp.style.fontWeight="normal"; mtem.style.fontWeight="normal"; setTimeout("zoomer("+ycol+")", speed); } else if (m_copo[ycol]==200) m_copo[ycol]=100+Math.floor(height/2); if (m_copo[ycol]>100 && m_copo[ycol]<200) { mtmp=table.rows[m_copo[ycol]-101].cells[ycol]; mtmp.firstChild.nodeValue=String.fromCharCode(160); mtem=table.rows[100+height-m_copo[ycol]].cells[ycol]; mtem.firstChild.nodeValue=String.fromCharCode(160); m_copo[ycol]-=1; setTimeout("zoomer("+ycol+")", speed); } } // ]]> </script> Second script: a simple digital clock. Code: <script type="text/javascript"> function showClock() { // create a new Date() object var currentTime=new Date(); var hours=currentTime.getHours(); var minutes=currentTime.getMinutes(); var seconds=currentTime.getSeconds(); var area=currentTime.getTimezoneOffset(); area=area/60; var clock=hours; // add a zero in front of numbers<10 if (minutes<10){ minutes="0" + minutes; } if (seconds<10){ seconds="0" + seconds; } document.getElementById('clock').innerHTML="<table><tr><td width=80 align=center>"+clock+":"+minutes+":"+seconds+"</td>" +"" +""; t=setTimeout('showClock()',500); // setTimeout calls showClock() function every 500 miliseconds, that means 0.5 seconds } </script> <body onload="showclock()"> this is where the clock load. It works fine. how do i get the other script to load with this. I can get them both to run but not at same time. Any1 outthere who have a solution. I believe it has something to do with Function() part in the matrix code. can i change that do another command? I need to be able to ensure that an html page will always load up in a particular browser. Let's say IE. Changing the default browser settings in the registry is horribly complex, and, besides, I don't want to override the user. That is, I envisage a javascript function on page load that checks which is the default browser in the user's machine. If it is IE, fine - page loads normally; if not IE, the page somehow forces a load in IE. Can it be done? I realise that you can make shortcuts that load up IE first and then a particular page, but that method has shortcomings: specifically the shortcut target below won't work in Windows 64-bit (and I must have a single shortcut for this task - not one for each Windows version). "C:\Program Files\Internet Explorer\iexplore.exe" -k "C:\Program Files\myfolder\README.html" So, I'm forced to try to do it in javascript from within the html page itself. Is it possible? My homepage has a lot of stuff running on it and I was just wondering if it's possible to actually pre-load an entire PHP page including images, scripts, etc...? I tried the method at http://stackoverflow.com/questions/7...uery-technique but it didn't work :\
Hi, I was wondering how to add a "loading page please wait" page to my web page, and then run any javascript only after the page loads? My web page contains some fade in/out scripts for pages, and all my pages are basically just divs and in one html file. Just a simple black container (not entire web page) with the words "loading" or something would be fine, then this page would fade out, then my main page would fade in. Thanks. so when the page is initially opened, i dont want the video to be showing until the preview button is clicked. Code: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Christmas Greets!</title> <script type="text/javascript"> <!-- function switchMenu(obj) { var el = document.getElementById(obj); if ( el.style.display != "none" ) { el.style.display = 'none'; } else { el.style.display = ''; } } //--> </script> </head> <body> <div id="wrapper"> <img src="somepicture.png" <p><a onclick="switchMenu('myvar');" title="View Greeting"><button>Preview</button></a></p> <div id="myvar"> <video width="240" height="160" controls="controls"> <source src="EatResponsibly.mp4" type="video/mp4" /> <source src="EatResponsibly.ogv" type="video/ogv" /> <source src="EatResponsibly.webm" type="video/webm" /> You Browser Does not Support This Video. Please Update Your Browser. </video> </div> </div> </body> </html> Hello, I am currently using Code: onload="document.getElementById("hidepage").style.visibility="hidden";" to try to hide a div box. Yet this will not work. I've tried FF, IEpp4 (IE platform preview 4) and IE9beta. This is the correct <div> id, and I do not know why this will not work. Thanks! I'm new to JavaScript, and this forum so please forgive any improprieties. What I'm trying to do is fairly simple. I have a script that creates some SVG rectangles. I want to be able to click a button and have two rectangles switch places, moving along a curve to do so. This is part of a prototype for a larger product. I've included the relevant code pieces below, and I've also included the whole .html file as an attachment if you prefer. I feel like I'm on the right track, but I cannot figure out why it is not working. I "believe" the problem is when I create the animateA and animateB elements (syntax perhaps?). Please let me know if this is not enough information, as I've been staring at it for so long I seem to have lost perspective. Thanks for any help. Code: var svgNS = "http://www.w3.org/2000/svg"; var xlinkNS = "http://www.w3.org/1999/xlink"; var animateDur = "1s"; function swap(a,b) { //this section handles moving the actual elements of the array //rectArray is an array of integer values that represent the height of the rectangles var temp = rectArray[a];; rectArray[a]=rectArray[b]; rectArray[b]=temp; //this section is for the animation (will probably be its own function //for the final version //get the elements var aRect = document.getElementById("rect_" + a); var bRect = document.getElementById("rect_" + b); //get the element coordinates, bY isn't needed, as it //is the same as bX var aX = aRect.getAttributeNS(null,"x"); var aY = aRect.getAttributeNS(null,"y"); var bX = bRect.getAttributeNS(null,"x"); //calculate the x distance from a to b and from b to a //to use in the bezier curve path var aToBx = bX - aX; var bToAx = aX - bX; //calculate the halfway point to use in the bezier curve var qA = Math.floor(aToBx/2); var qB = Math.floor(bToAx/2); //create the path strings: //should be M startX startY q midpointX midpointY endX endY //notice that endX and endY are with respect to the startX and startY var pathAtoB = "M" + aX + " " + aY + " q " + qA + " 30 " + aToBx + " " + aY; var pathBtoA = "M" + bX + " " + bY + " q " + qB + " 30 " + bToAx + " " + aY; //create the animation element for rectangle A animateA = document.createElementNS(svgNS, "animateMotion"); animateA.setAttributeNS(null,"path",pathAtoB); animateA.setAttributeNS(null,"dur",animateDur); //append it to the rectangle aRect.appendChild(animateA); //create the animation element for rectangle B animateB = document.createElementNS(svgNS, "animateMotion"); animateB.setAttributeNS(null,"path",pathBtoA); animateB.setAttributeNS(null,"dur",animateDur); //append it to the rectangle bRect.appendChild(animateB); //change the id's of the rectangles to reflect their new //positions aRect.setAttributeNS(null,"id","rect_" + b); bRect.setAttributeNS(null,"id","rect_" + a); } So, I've built this navigation bar so far and I'm curious if it's even possible to achieve what I'm thinking. Currently, when you hover over each of the links they drop down (padding is increased). Now, what I'm curious in doing is if you hover over say "test1", test2-4 also drop with it but in the padding that has been created from the drop down, "test1" information shows up. Allowing the user to click or read whatever information is in there. Also, if the user would like to, they can move their mouse to test2 and everything would animate (opacity, this I can do I think) to whatever is in the test2 field, test3 doing the same and so on. I haven't had much success with this, I've created a completely separate panel before, but that didn't exactly work or I wasn't doing it correctly. Here is what I've been working on, ANY help would be appreciated! Thanks! Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(function() { $("#nav li > a").hover(function() { $(this).stop().animate({paddingTop: "100px"}, 100); }, function() { $(this).stop().animate({paddingTop: "10px"}, 200); }); }); </script> <style type="text/css"> #nav { position: absolute; top: 0; left: 60px; padding: 0; margin: 0; list-style: none; } #nav li { display: inline; } #nav li a { float: left; display: block; color: #555; text-decoration: none; padding: 10px 30px; background-color: #d1d1d1; border-top: none; } </style> </head> <body> <div id="wrap"> <ul id="nav"> <li><a href="">test1</a></li> <li><a href="">test2</a></li> <li><a href="">test3</a></li> <li><a href="">test4</a></li> </ul> </div> </body> </html> Hello. I have my animation script working and I use setInterval to move by a number of pixels specified as 'this.gap', which defaults to 2 pixels (or 2/100's for opacity). I would like to use a curve, such as the first half of a sine curve, for a more graceful effect. Before the setInterval is begun I know the 'from' and 'to' position and believe I could use these initial values to work out the gaps to move on each iteration. (My code is slightly complicated by the fact that I change an x value and either the 'from' or 'to' value depending on whether I'm increasing or decreasing the left/top/opacity.) My maths is a little rusty and any suggestion would be welcome Here's a code snippet but I could provide more on request. Andy. Code: function animateIt(o) { if ( o.from < o.to ) { var y = ( o.type == 'opacity' ) ? 100 : 1; o.x = (o.positive) ? o.x + this.gap/y : o.x - this.gap/y; if ( o.type == 'opacity' ) { this.theObj.style.filter = "alpha(opacity=" + (o.x * 100) + ")"; this.theObj.style.opacity = o.x; } else { this.theObj.style[o.type] = o.x + 'px'; } (o.positive) ? o.from += this.gap/y : o.to -= this.gap/y; } else { this.stopIt(); } } PS i have posted elsewhere but no response as yet. |