Avatar billede hatc11 Nybegynder
10. januar 2007 - 00:49 Der er 11 kommentarer og
1 løsning

Lille nyhedsbar i FP2002

Jeg er ved at lave en nyhedsbar i fp2002, Jeg fandt en som virker UDEN php og det passer mig fint for jeg kan, og har ikke tid til at lære det lige nu.
1. problem. Den viser teksten i flere forskellige farver, jeg ønsker kun sort tekst.
2. problem. jeg kunne godt tænke mig at teksten bare rullede i stedet for at blinke.

Håber i kan hjælpe asap.
Avatar billede hatc11 Nybegynder
10. januar 2007 - 00:52 #1
Manglede lige scripten..

<html>
<head>
</head>

<body>

<!-- SCRIPT - newsfader -->

<script language="JavaScript1.2">

//----------------------------------------------------------

var str="2"        // angiv skriftstørrelse i punkter
var font="arial"    // angiv skrifttype
var delay=5000          // angiv tid til hver besked
var overgang=200    // angiv overgangstid
var fwidth=100      // angiv bredde på tekstboks
var fheight=70      // angiv højde på tekstboks

// rammen defineres herefter - tykkelse i pixel
// rammetype - solid, none, dotted, dashed etc.
var ramme="2px dotted #0000ff"


// Du skal ikke ændre noget i disse syv linier
var overskrift=new Array()
var tekst=new Array()
var link=new Array()
var linktekst=new Array()
var fcontent=new Array()
begintag='<font face="' + font + '" size=' + str + '>'
closetag='</font>'

// Angiv hvor mange tekster der skal være
var antal=3


// Skriv overskrifter, tekster og links herunder.
// Sæt link="NIL" hvis du ikke ønsker link til
// den pågældende tekst.
// Du kan lave flere tekster ved at følge samme
// struktur. Husk bare at ændre antal herover.

overskrift[0]="Ooverskrift 1"
tekst[0]="Her kommer så brødskriften"
link[0]="dinside.htm"
linktekst[0]="link 1"

overskrift[1]="Overskrift 2"
tekst[1]="Brødtekst 2"
link[1]="NIL"
linktekst[1]="link 2"

overskrift[2]="Overskrift 3"
tekst[2]="Dette er ret cool script"
link[2]="link.htm"
linktekst[2]="link 3"


////// Du skal ikke ændre noget efter denne linie /////

var x
for (x = 0;x < antal;x++) {
if (link[x] == "NIL") {
fcontent[x]="<b>" + overskrift[x] + "</b><br>" + tekst[x]
}
else {
fcontent[x]="<b>" + overskrift[x] + "</b><br>" + tekst[x] + "<br><a href='" + link [x] + "'>" + linktekst[x] + "</a>"
}
}


var ie4=document.all&&!document.getElementById
var ns4=document.layers
var DOM2=document.getElementById
var faderdelay=0
var index=0

if (DOM2)
faderdelay=100

//function til at aendre indhold
function changecontent(){
if (index>=fcontent.length)
index=0
if (DOM2){
document.getElementById("fscroller").style.color= "rgb(255,255,255)"
document.getElementById("fscroller").innerHTML= begintag+fcontent[index]+closetag
//http://www.a-begynder.dk
colorfade()
}
else if (ie4)
document.all.fscroller.innerHTML=begintag+ fcontent[index]+ closetag
else if (ns4){
document.fscrollerns.document.fscrollerns_sub. document.write( begintag+fcontent[index]+closetag)
document.fscrollerns.document.fscrollerns_sub. document.close()
}

index++
setTimeout("changecontent()",delay+faderdelay)
}


frame=20;
hex=255 // startfarve

function colorfade() {
//http://www.a-begynder.dk
if(frame>0) {
hex-=12; // foroeg farve vaerdi
document.getElementById("fscroller").style.color= "rgb("+hex+","+hex+","+hex+")"; // Set color value.
frame--;
setTimeout("colorfade()",overgang);
}
else{
document.getElementById("fscroller").style.color= "rgb(0,0,0)";
frame=20;
hex=255
}
}

if (ie4||DOM2)
document.write('<div id="fscroller" style="border:' + ramme + ';width:'+fwidth+';height:'+fheight+ ';padding:2px"></div>')

window.onload=changecontent
</script>


<!-- SCRIPT - newsfader - SLUT -->



</body>

</html>
Avatar billede mclemens Nybegynder
10. januar 2007 - 10:15 #2
Avatar billede mclemens Nybegynder
10. januar 2007 - 10:20 #3
Forresten a-begynder er nogle rigtige
kopister ... sammenlign lige disse to:

http://www.a-begynder.dk/scripts/javascript/teksteffekter/javascript_tekst_glowing.htm

vs.

http://www.dynamicdrive.com/dynamicindex10/glowtext.htm

... Tror sgu jeg anmelder dem ...
Avatar billede mclemens Nybegynder
10. januar 2007 - 10:55 #4
Hehe, har ikke fundet noget script
derinde som ikke er kopieret ...

... Kan du bruge 10:15:32 ?
Avatar billede hatc11 Nybegynder
10. januar 2007 - 14:33 #5
Ideen er fin, og vi er der næsten, men..
1. det er kun den øverste bar jeg skal bruge
2. bundfarven er beskrevet som lightyellow,men den skal ændres til (R,G,B)(145,132,118)=(hex:918476)

Scripten er :

<style type="text/css">

/*Example CSS for the two demo scrollers*/

#pscroller1{
width: 200px;
height: 100px;
border: 1px solid black;
padding: 5px;
background-color: lightyellow;
}

#pscroller2{
width: 350px;
height: 20px;
border: 1px solid black;
padding: 3px;
}

#pscroller2 a{
text-decoration: none;
}

.someclass{ //class to apply to your scroller(s) if desired
}

</style>

<script type="text/javascript">

/*Example message arrays for the two demo scrollers*/

var pausecontent=new Array()
pausecontent[0]='<a href="http://www.javascriptkit.com">JavaScript Kit</a><br />Comprehensive JavaScript tutorials and over 400+ free scripts!'
pausecontent[1]='<a href="http://www.codingforums.com">Coding Forums</a><br />Web coding and development forums.'
pausecontent[2]='<a href="http://www.cssdrive.com" target="_new">CSS Drive</a><br />Categorized CSS gallery and examples.'

var pausecontent2=new Array()
pausecontent2[0]='<a href="http://www.news.com">News.com: Technology and business reports</a>'
pausecontent2[1]='<a href="http://www.cnn.com">CNN: Headline and breaking news 24/7</a>'
pausecontent2[2]='<a href="http://news.bbc.co.uk">BBC News: UK and international news</a>'

</script>

<script type="text/javascript">

/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

</script>

-------------------------------------------------------

<script type="text/javascript">

//new pausescroller(name_of_message_array, CSS_ID, CSS_classname, pause_in_miliseconds)

new pausescroller(pausecontent, "pscroller1", "someclass", 3000)
document.write("<br />")
new pausescroller(pausecontent2, "pscroller2", "someclass", 2000)

</script>
Avatar billede hatc11 Nybegynder
10. januar 2007 - 15:08 #6
Lige en ting mere.. Jeg vil også gerne kunne ændre skrifttypen (font) men kan ikke finde hvor det ændre.
Avatar billede mclemens Nybegynder
10. januar 2007 - 15:43 #7
Se på denne rettede:

new pausescroller(pausecontent, "mincssid", "mincssklasse", 3000)
i bunden med id og så herefter klassen
- i #mincssid styles er tilføjet:
font-family: verdana,sans-serif;
og baggrunden er rettet til
background-color: rgb(145,132,118);


... Du styrer udseende med css, ved hjælp af id og/eller klasser ...




<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="content-type" content="text/html; charset=iso-8859-1"><title>Ingen titel</title><meta name="robots" content="index, follow">

<style type="text/css">

/*Example CSS for the two demo scrollers*/

#mincssid{
width: 200px;
height: 100px;
border: 1px solid black;
padding: 5px;
font-family: verdana,sans-serif;
background-color: rgb(145,132,118);
}

.someclass{ //class to apply to your scroller(s) if desired
}

</style>

<script type="text/javascript">

/*Example message arrays for the one demo scrollers*/

var pausecontent=new Array()
pausecontent[0]='<a href="http://www.javascriptkit.com">JavaScript Kit</a><br />Comprehensive JavaScript tutorials and over 400+ free scripts!'
pausecontent[1]='<a href="http://www.codingforums.com">Coding Forums</a><br />Web coding and development forums.'
pausecontent[2]='<a href="http://www.cssdrive.com" target="_new">CSS Drive</a><br />Categorized CSS gallery and examples.'

</script>

<script type="text/javascript">

/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

</script>

</head><body>


<script type="text/javascript">

//new pausescroller(name_of_message_array, CSS_ID, CSS_classname, pause_in_miliseconds)

new pausescroller(pausecontent, "mincssid", "someclass", 3000)

</script>


</body></html>
Avatar billede hatc11 Nybegynder
10. januar 2007 - 16:40 #8
OK, nu er jeg begynder på området, men jeg fatter ikke hvorfor den fucker teksten op når jeg sætter din script ind ?

Kan du se noget logisk eller er det bare mig der en nørd. :



<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 4</title>
<base target="_self">
</head>

<body bgcolor="#918476">

</body>

&lt;style type="text/css"&gt;<BR><BR>/*Example CSS for the two demo
scrollers*/<BR><BR>#mincssid{<BR>width: 200px;<BR>height: 100px;<BR>border: 1px
solid black;<BR>padding: 5px;<BR>font-family:
verdana,sans-serif;<BR>background-color:
rgb(145,132,118);<BR>}<BR><BR>.someclass{ //class to apply to your scroller(s)
if desired<BR>}<BR><BR>&lt;/style&gt;<BR><BR>&lt;script
type="text/javascript"&gt;<BR><BR>/*Example message arrays for the one demo
scrollers*/<BR><BR>var pausecontent=new Array()<BR>pausecontent[0]='&lt;a
href="<A href="http://www.javascriptkit.com"
target=_blank>http://www.javascriptkit.com</A>"&gt;JavaScript
Kit&lt;/a&gt;&lt;br /&gt;Comprehensive JavaScript tutorials and over 400+ free
scripts!'<BR>pausecontent[1]='&lt;a href="<A href="http://www.codingforums.com"
target=_blank>http://www.codingforums.com</A>"&gt;Coding Forums&lt;/a&gt;&lt;br
/&gt;Web coding and development forums.'<BR>pausecontent[2]='&lt;a href="<A
href="http://www.cssdrive.com" target=_blank>http://www.cssdrive.com</A>"
target="_new"&gt;CSS Drive&lt;/a&gt;&lt;br /&gt;Categorized CSS gallery and
examples.'<BR><BR>&lt;/script&gt;<BR><BR>&lt;script
type="text/javascript"&gt;<BR><BR>/***********************************************<BR>*
Pausing up-down scroller- © Dynamic Drive (<A href="http://www.dynamicdrive.com"
target=_blank>www.dynamicdrive.com</A>)<BR>* This notice MUST stay intact for
legal use<BR>* Visit <A href="http://www.dynamicdrive.com/"
target=_blank>http://www.dynamicdrive.com/</A> for this script and 100s
more.<BR>***********************************************/<BR><BR>function
pausescroller(content, divId, divClass, delay){<BR>this.content=content
//message array content<BR>this.tickerid=divId //ID of ticker div to display
information<BR>this.delay=delay //Delay between msg change, in
miliseconds.<BR>this.mouseoverBol=0 //Boolean to indicate whether mouse is
currently over scroller (and pause it if it is)<BR>this.hiddendivpointer=1
//index of message array for hidden div<BR>document.write('&lt;div id="'+divId+"
class="'+divClass+'" style="position: relative; overflow: hidden"&gt;&lt;div
class="innerDiv" style="position: absolute; width: 100%"
id="'+divId+'1"&gt;'+content[0]+'&lt;/div&gt;&lt;div class="innerDiv"
style="position: absolute; width: 100%; visibility: hidden"
id="'+divId+'2"&gt;'+content[1]+'&lt;/div&gt;&lt;/div&gt;')<BR>var
scrollerinstance=this<BR>if (window.addEventListener) //run onload in DOM2
browsers<BR>window.addEventListener("load",
function(){scrollerinstance.initialize()}, false)<BR>else if
(window.attachEvent) //run onload in IE5.5+<BR>window.attachEvent("onload",
function(){scrollerinstance.initialize()})<BR>else if (document.getElementById)
//if legacy DOM browsers, just start scroller after 0.5
sec<BR>setTimeout(function(){scrollerinstance.initialize()}, 500)<BR>}<BR><BR>//
-------------------------------------------------------------------<BR>//
initialize()- Initialize scroller method.<BR>// -Get div objects, set initial
positions, start up down animation<BR>//
-------------------------------------------------------------------<BR><BR>pausescroller.prototype.initialize=function(){<BR>this.tickerdiv=document.getElementById(this.tickerid)<BR>this.visiblediv=document.getElementById(this.tickerid+"1")<BR>this.hiddendiv=document.getElementById(this.tickerid+"2")<BR>this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))<BR>//set
width of inner DIVs to outer DIV's width minus padding (padding assumed to be
top padding x
2)<BR>this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"<BR>this.getinline(this.visiblediv,
this.hiddendiv)<BR>this.hiddendiv.style.visibility="visible"<BR>var
scrollerinstance=this<BR>document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}<BR>document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}<BR>if
(window.attachEvent) //Clean up loose references in
IE<BR>window.attachEvent("onunload",
function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})<BR>setTimeout(function(){scrollerinstance.animateup()},
this.delay)<BR>}<BR><BR><BR>//
-------------------------------------------------------------------<BR>//
animateup()- Move the two inner divs of the scroller up and in sync<BR>//
-------------------------------------------------------------------<BR><BR>pausescroller.prototype.animateup=function(){<BR>var
scrollerinstance=this<BR>if
(parseInt(this.hiddendiv.style.top)&gt;(this.visibledivtop+5)){<BR>this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"<BR>this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"<BR>setTimeout(function(){scrollerinstance.animateup()},
50)<BR>}<BR>else{<BR>this.getinline(this.hiddendiv,
this.visiblediv)<BR>this.swapdivs()<BR>setTimeout(function(){scrollerinstance.setmessage()},
this.delay)<BR>}<BR>}<BR><BR>//
-------------------------------------------------------------------<BR>//
swapdivs()- Swap between which is the visible and which is the hidden div<BR>//
-------------------------------------------------------------------<BR><BR>pausescroller.prototype.swapdivs=function(){<BR>var
tempcontainer=this.visiblediv<BR>this.visiblediv=this.hiddendiv<BR>this.hiddendiv=tempcontainer<BR>}<BR><BR>pausescroller.prototype.getinline=function(div1,
div2){<BR>div1.style.top=this.visibledivtop+"px"<BR>div2.style.top=Math.max(div1.parentNode.offsetHeight,
div1.offsetHeight)+"px"<BR>}<BR><BR>//
-------------------------------------------------------------------<BR>//
setmessage()- Populate the hidden div with the next message before it's
visible<BR>//
-------------------------------------------------------------------<BR><BR>pausescroller.prototype.setmessage=function(){<BR>var
scrollerinstance=this<BR>if (this.mouseoverBol==1) //if mouse is currently over
scoller, do nothing (pause
it)<BR>setTimeout(function(){scrollerinstance.setmessage()},
100)<BR>else{<BR>var i=this.hiddendivpointer<BR>var
ceiling=this.content.length<BR>this.hiddendivpointer=(i+1&gt;ceiling-1)? 0 :
i+1<BR>this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]<BR>this.animateup()<BR>}<BR>}<BR><BR>pausescroller.getCSSpadding=function(tickerobj){
//get CSS padding value, if any<BR>if (tickerobj.currentStyle)<BR>return
tickerobj.currentStyle["paddingTop"]<BR>else if (window.getComputedStyle) //if
DOM2<BR>return window.getComputedStyle(tickerobj,
"").getPropertyValue("padding-top")<BR>else<BR>return
0<BR>}<BR><BR>&lt;/script&gt;<BR><BR>&lt;/head&gt;&lt;body&gt;<BR><BR><BR>&lt;script
type="text/javascript"&gt;<BR><BR>//new pausescroller(name_of_message_array,
CSS_ID, CSS_classname, pause_in_miliseconds)<BR><BR>new
pausescroller(pausecontent, "mincssid", "someclass",
3000)<BR><BR>&lt;/script&gt;<BR><BR><BR>&lt;/body&gt;&lt;/html&gt;



<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 4</title>
<base target="_self">
</head>

<body bgcolor="#918476">

</body>

&lt;style type="text/css"&gt;<BR><BR>/*Example CSS for the two demo
scrollers*/<BR><BR>#mincssid{<BR>width: 200px;<BR>height: 100px;<BR>border: 1px
solid black;<BR>padding: 5px;<BR>font-family:
verdana,sans-serif;<BR>background-color:
rgb(145,132,118);<BR>}<BR><BR>.someclass{ //class to apply to your scroller(s)
if desired<BR>}<BR><BR>&lt;/style&gt;<BR><BR>&lt;script
type="text/javascript"&gt;<BR><BR>/*Example message arrays for the one demo
scrollers*/<BR><BR>var pausecontent=new Array()<BR>pausecontent[0]='&lt;a
href="<A href="http://www.javascriptkit.com"
target=_blank>http://www.javascriptkit.com</A>"&gt;JavaScript
Kit&lt;/a&gt;&lt;br /&gt;Comprehensive JavaScript tutorials and over 400+ free
scripts!'<BR>pausecontent[1]='&lt;a href="<A href="http://www.codingforums.com"
target=_blank>http://www.codingforums.com</A>"&gt;Coding Forums&lt;/a&gt;&lt;br
/&gt;Web coding and development forums.'<BR>pausecontent[2]='&lt;a href="<A
href="http://www.cssdrive.com" target=_blank>http://www.cssdrive.com</A>"
target="_new"&gt;CSS Drive&lt;/a&gt;&lt;br /&gt;Categorized CSS gallery and
examples.'<BR><BR>&lt;/script&gt;<BR><BR>&lt;script
type="text/javascript"&gt;<BR><BR>/***********************************************<BR>*
Pausing up-down scroller- © Dynamic Drive (<A href="http://www.dynamicdrive.com"
target=_blank>www.dynamicdrive.com</A>)<BR>* This notice MUST stay intact for
legal use<BR>* Visit <A href="http://www.dynamicdrive.com/"
target=_blank>http://www.dynamicdrive.com/</A> for this script and 100s
more.<BR>***********************************************/<BR><BR>function
pausescroller(content, divId, divClass, delay){<BR>this.content=content
//message array content<BR>this.tickerid=divId //ID of ticker div to display
information<BR>this.delay=delay //Delay between msg change, in
miliseconds.<BR>this.mouseoverBol=0 //Boolean to indicate whether mouse is
currently over scroller (and pause it if it is)<BR>this.hiddendivpointer=1
//index of message array for hidden div<BR>document.write('&lt;div id="'+divId+"
class="'+divClass+'" style="position: relative; overflow: hidden"&gt;&lt;div
class="innerDiv" style="position: absolute; width: 100%"
id="'+divId+'1"&gt;'+content[0]+'&lt;/div&gt;&lt;div class="innerDiv"
style="position: absolute; width: 100%; visibility: hidden"
id="'+divId+'2"&gt;'+content[1]+'&lt;/div&gt;&lt;/div&gt;')<BR>var
scrollerinstance=this<BR>if (window.addEventListener) //run onload in DOM2
browsers<BR>window.addEventListener("load",
function(){scrollerinstance.initialize()}, false)<BR>else if
(window.attachEvent) //run onload in IE5.5+<BR>window.attachEvent("onload",
function(){scrollerinstance.initialize()})<BR>else if (document.getElementById)
//if legacy DOM browsers, just start scroller after 0.5
sec<BR>setTimeout(function(){scrollerinstance.initialize()}, 500)<BR>}<BR><BR>//
-------------------------------------------------------------------<BR>//
initialize()- Initialize scroller method.<BR>// -Get div objects, set initial
positions, start up down animation<BR>//
-------------------------------------------------------------------<BR><BR>pausescroller.prototype.initialize=function(){<BR>this.tickerdiv=document.getElementById(this.tickerid)<BR>this.visiblediv=document.getElementById(this.tickerid+"1")<BR>this.hiddendiv=document.getElementById(this.tickerid+"2")<BR>this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))<BR>//set
width of inner DIVs to outer DIV's width minus padding (padding assumed to be
top padding x
2)<BR>this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"<BR>this.getinline(this.visiblediv,
this.hiddendiv)<BR>this.hiddendiv.style.visibility="visible"<BR>var
scrollerinstance=this<BR>document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}<BR>document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}<BR>if
(window.attachEvent) //Clean up loose references in
IE<BR>window.attachEvent("onunload",
function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})<BR>setTimeout(function(){scrollerinstance.animateup()},
this.delay)<BR>}<BR><BR><BR>//
-------------------------------------------------------------------<BR>//
animateup()- Move the two inner divs of the scroller up and in sync<BR>//
-------------------------------------------------------------------<BR><BR>pausescroller.prototype.animateup=function(){<BR>var
scrollerinstance=this<BR>if
(parseInt(this.hiddendiv.style.top)&gt;(this.visibledivtop+5)){<BR>this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"<BR>this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"<BR>setTimeout(function(){scrollerinstance.animateup()},
50)<BR>}<BR>else{<BR>this.getinline(this.hiddendiv,
this.visiblediv)<BR>this.swapdivs()<BR>setTimeout(function(){scrollerinstance.setmessage()},
this.delay)<BR>}<BR>}<BR><BR>//
-------------------------------------------------------------------<BR>//
swapdivs()- Swap between which is the visible and which is the hidden div<BR>//
-------------------------------------------------------------------<BR><BR>pausescroller.prototype.swapdivs=function(){<BR>var
tempcontainer=this.visiblediv<BR>this.visiblediv=this.hiddendiv<BR>this.hiddendiv=tempcontainer<BR>}<BR><BR>pausescroller.prototype.getinline=function(div1,
div2){<BR>div1.style.top=this.visibledivtop+"px"<BR>div2.style.top=Math.max(div1.parentNode.offsetHeight,
div1.offsetHeight)+"px"<BR>}<BR><BR>//
-------------------------------------------------------------------<BR>//
setmessage()- Populate the hidden div with the next message before it's
visible<BR>//
-------------------------------------------------------------------<BR><BR>pausescroller.prototype.setmessage=function(){<BR>var
scrollerinstance=this<BR>if (this.mouseoverBol==1) //if mouse is currently over
scoller, do nothing (pause
it)<BR>setTimeout(function(){scrollerinstance.setmessage()},
100)<BR>else{<BR>var i=this.hiddendivpointer<BR>var
ceiling=this.content.length<BR>this.hiddendivpointer=(i+1&gt;ceiling-1)? 0 :
i+1<BR>this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]<BR>this.animateup()<BR>}<BR>}<BR><BR>pausescroller.getCSSpadding=function(tickerobj){
//get CSS padding value, if any<BR>if (tickerobj.currentStyle)<BR>return
tickerobj.currentStyle["paddingTop"]<BR>else if (window.getComputedStyle) //if
DOM2<BR>return window.getComputedStyle(tickerobj,
"").getPropertyValue("padding-top")<BR>else<BR>return
0<BR>}<BR><BR>&lt;/script&gt;<BR><BR>&lt;/head&gt;&lt;body&gt;<BR><BR><BR>&lt;script
type="text/javascript"&gt;<BR><BR>//new pausescroller(name_of_message_array,
CSS_ID, CSS_classname, pause_in_miliseconds)<BR><BR>new
pausescroller(pausecontent, "mincssid", "someclass",
3000)<BR><BR>&lt;/script&gt;<BR><BR><BR>&lt;/body&gt;&lt;/html&gt;
Avatar billede mclemens Nybegynder
10. januar 2007 - 18:08 #9
Du er ikke en nørd, du bruger frontpage.
Jeg er en nørd, jeg bruger notesblok.

Du indsætter indholdet direkte copy'n'paste ind
på siden, det skal indsættes direkte i html tab'en.
Jeg legede med frontpage i '99 og kan ikke huske
detaljerne og det er muligt at det er ændret siden.

... Evt. skal du blot indsætte script delene i html
tab'en sammen med style delen, på de rette placeringer.

Prøv at åbne notesblok, kopier alt i 10/01-2007 15:43:02
fra "<!DOCTYPE ..." ned til "...</html>" indsæt det
i notesblok og vælg gem som, test.html ... åben
filen og test resultatet :)
Avatar billede mclemens Nybegynder
10. januar 2007 - 18:22 #10
Jeg ved ikke hvor meget du har læst
om brugen af frontpage som editor.
Kig evt. på tutorials herinde:

http://office.microsoft.com/da-dk/training/CR061832701030.aspx
Avatar billede hatc11 Nybegynder
30. januar 2007 - 23:24 #11
mclemens> Jeg kan ikke rigtig få det til at fungere. Jeg fandt dog en anden nýhedsbar som virkede, MEN kan ikke se den under designsiden kun når jeg skal se den i en browser ???, men jeg har lige fået et andet akut problem med en makine som er gået, så du får points'ne alligevel som tak for hjælpen.
Avatar billede mclemens Nybegynder
31. januar 2007 - 08:26 #12
Ok, tak for point :)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester