Талисман
ФОРУМ КАМИНИ • Виж темата - Интересни автоматични скролове за страница


ФОРУМ КАМИНИ

форум за камини и нещата наоколо
Дата и час: Октомври 22nd, 2018, 7:19 pm

Часовете са според зоната UTC + 2 часа



stan

ars


Напиши нова тема Отговори на тема  [ 1 мнение ] 
Автор Съобщение
МнениеПубликувано на: Април 30th, 2013, 11:10 am 
Site Admin

Регистриран на: Ноември 4th, 2011, 8:45 pm
Мнения: 678
Step 1: Insert the below code in the <head> section of your page:

Код:
<style type="text/css">

#marqueecontainer{
position: relative;
width: 200px; /*marquee width */
height: 200px; /*marquee height */
background-color: white;
overflow: hidden;
border: 3px solid orange;
padding: 2px;
padding-left: 4px;
}

</style>

<script type="text/javascript">

/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=2 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee


</script>





The CSS at the top controls the basic look of the marquee. Also refer to the variables inside script for additional config options.

Step 2: Then add the below HTML to the <body> where you want the marquee to appear:

Код:
<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">

<!--YOUR SCROLL CONTENT HERE-->

<h4>Your scroller contents</h4>

<!--YOUR SCROLL CONTENT HERE-->

</div>
</div>



================================

Код:
<SCRIPT language=JavaScript1.2>

//change 1 to another integer to alter the scroll speed. Greater is faster

var speed=1

var currentpos=0,alt=1,curpos1=0,curpos2=-1

function initialize(){

startit()

}

function scrollwindow(){

if (document.all &&

!document.getElementById)

temp=document.body.scrollTop

else

temp=window.pageYOffset

if (alt==0)

alt=2

else

alt=1

if (alt==0)

curpos1=temp

else

curpos2=temp

if (curpos1!=curpos2){

if (document.all)

currentpos=document.body.scrollTop+speed

else

currentpos=window.pageYOffset+speed

window.scroll(0,currentpos)

}

else{

currentpos=0

window.scroll(0,currentpos)

}

}

function startit(){

setInterval("scrollwindow()",50)

}

window.onload=initialize

</SCRIPT>

http://www.brownielocks.com/autoscroll1.html

http://dynamicdrive.com/dynamicindex2/cmarquee2.htm

_________________
Изображение
камини - http://www.zidkam.com


Върнете се в началото
 Профил  
 
Покажи мненията от миналия:  Сортирай по  
Напиши нова тема Отговори на тема  [ 1 мнение ] 

Часовете са според зоната UTC + 2 часа


Вие не можете да пускате нови теми
Вие не можете да отговаряте на теми
Вие не можете да променяте собственото си мнение
Вие не можете да изтривате собствените си мнения
Вие не можете да прикачвате файл

cron
Powered by phpBB® Forum Software © phpBB Group

Zidkam


Камини,Барбекю,Пещи
http://zidkam.com/


stan