i have a scroller (i got somewhere)
and here is the code. i omitted the javascript functions :
---------------
<DIV id="divUpControl" style="top: 60; left: 40">
<a href="#" onMouseOver="MM_swapImage(
'Image5','
','images/
prevx.gif'
,1); PerformScroll(-7)" onMouseOut="MM_swapImgRest
ore(); CeaseScroll()">
<IMG height=20 src="images/prev.gif" width=34 border=0 name="Image5"></A></div>
<DIV id="divDownControl" style="top: 340; left: 40">
<a href="#" onMouseOver="MM_swapImage(
'Image6','
','images/
nextx.gif'
,1); PerformScroll(7)" onMouseOut="MM_swapImgRest
ore(); CeaseScroll()">
<IMG height=22 src="images/next.gif" width=34 border=0 name="Image6"></A></DIV>
<div id="divContainer" style="left: 40; width: 400; top: 100; height: 220; clip: rect(0 400 230 0)">
<div id="divContent">
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
</div>
</div
-------------
now what i want is is i have a button somewhere in the page, and if i click on it, the content of "divContent" will change to whatever text i predefined. how do i do that? any snippets u guys keeping on your treasure chest? thx in advance!
ps. i already have a similar code like that (replaces the text, just like a normal frame). but it uses the <iframe> (inline frame) tag which i dont know if the scroller script is compatible with it.
it goers something like :
<LAYER id=content HEIGHT="220" WIDTH="398" TOP="118" LEFT="19"
ONLOAD="hookupEvents(this)
"><IFRAME
style="LEFT: 19px; WIDTH: 398px; TOP: 118px; HEIGHT: 220px" name=content
src="home.htm" width=219 scrolling=no></IFRAME></LA
YER>
and has the code :
<SCRIPT>
function doClick(ev) {
if (ev.target.href) {
var layer = document.layers[ev.target.
target]
if (layer) {
layer.src = ev.target.href
return false
}
}
this.routeEvent(ev)
return true
}
function hookupEvents(el) {
el.captureEvents(Event.CLI
CK)
el.onclick = doClick
}
var ieDHTML = document.all !=null
var nsDHTML = document.layers
function checkFrames() {
var iframes = window.frames
var numFrames = iframes.length
for (var i=0; i < numFrames; i++) {
var f = iframes[i]
if ((f.document.readyState=="
complete")
&& (f.document.cached==null))
{
f.document.body.style.bord
er = "none"
var elFrame = document.all[f.name].tags(
"IFRAME")[
0]
elFrame.style.height = f.document.body.scrollHeig
ht
f.document.cached = true
}
}
setTimeout("checkFrames()"
,100)
}
if (nsDHTML) {
window.captureEvents(Event
.CLICK)
window.onclick = doClick
}
if (ieDHTML)
checkFrames()
</SCRIPT>
Start Free Trial