Path: csiph.com!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Fokke Nauta Newsgroups: comp.lang.javascript Subject: Re: Continuous vertical marquee doesn't work properly Date: Wed, 14 Nov 2012 13:40:35 +0100 Lines: 64 Message-ID: References: <50a2775e$0$21237$ba4acef3@reader.news.orange.fr> <50a3717c$0$23441$ba4acef3@reader.news.orange.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net oxMA5rzJahRMw5ZraWk3SAlFUfFZIq/eJsUdkZclnSe4dXhYMFRJA5jWfzeVmMOTN3 Cancel-Lock: sha1:PjIdvKglMnRNnAYDaEWm8RKm+NQ= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 In-Reply-To: <50a3717c$0$23441$ba4acef3@reader.news.orange.fr> Xref: csiph.com comp.lang.javascript:17237 On 14/11/2012 11:24, SAM wrote: > Le 14/11/12 08:33, Fokke Nauta a écrit : >> On 13/11/2012 17:37, SAM wrote: >>> Le 13/11/12 15:34, Fokke Nauta a écrit : >>>> Hi all, >>>> >>>> I use a script from www.dynamicdrive.com for a continous vertical >>>> marquee, called Cross browser Marquee II. >>> >>> a script from last century, no ? >> >> OK, if this script is so ancient, die you have a better alternative? > > The best : try to see, understand and learn the css 'transition' > (adios all old browsers !) > > > > I imagine you can tinker and try to realize : > - a div sized (the sreen where to display the slider) > styled in overflow:hidden; > - a div contained by the screen above (id="slider") > (why same width or a few less) > - that div gets the pictures sized (css) in width:99%; > - you find/create a routine to slide up that div > - when 2nd picture is entirely seen you move the 1st at end > (and minimize the counter by the height of that picture) > - and so on > > var c = 0, > speed = 50, // bigger = slower > slids = false; > > function $(div) { > if(typeof div !='string') return div; > // we'll try to interest NatsCape but ... is it yet usefull ? > return document.layers? document.layers[div] : > // then all the IEs > document.all&&!window.opera? document.all[div] : > // and finally the respectful browsers > document.getElementById(div); > } > function movetop() { > c++; > $('slider').marginTop = - c +'px'; > var s = $('slider').getElementsByTagName('IMG'); > if (c*(-1)>= s[0].height) { > c = c + s[0].height; > $('slider').appendChild(s[0]); // zoo! 1st at end > } > slids = setTimeout(movetop,speed); // may not work with IE5 > } > funtion stopImg() { clearTimeout(slids); slids=false; } > window.onload = movetop; > Thanks very much for your help. But I'm afraid this is still too complex for me to get this running. For instance, "you find/create a routine to slide up that div": I haven't got a clue as how to do this. But as you can see in this thread, I already managed to get my script running. Even if it's ancient. Fokke