PDA

View Full Version : Targeting Scrollable Content Script II



probably james
08-07-2005, 09:28 PM
Scrollable Content Script II

http://www.dynamicdrive.com/dynamicindex11/scrollc2.htm

I was wondering if it were possible to use a hide/show script that was targeted to the Scrollable content script II. I can't exactly explain it so here's an image:

http://www.kornkult.com/demo.jpg

I need all the help I can get, guys. I've been brooding about this for weeks now and finally it's time to ask. Thanks

jscheuer1
08-08-2005, 04:31 PM
OK, in the script find the function called:

getcontent_height()

Replace these two lines:

if (iens6)
contentheight=crossobj.offsetHeightwith these:

if (iens6){
contentheight=crossobj.offsetHeight
temp=crossobj.innerHTML
}Just above the function getcontent_height() insert this new function:

function switchConts(id){
if (id=='content')
crossobj.innerHTML=temp
else
crossobj.innerHTML=document.all? document.all[id].innerHTML : document.getElementById(id).innerHTML
contentheight=crossobj.offsetHeight
}Now you can make additional content divisions on the page. A good place to put them is at the end of the document, just above the </body> tag. They will look something like this:

<div id="content2" style="display:none">
Here is a bunch of additional content that will be displayed when you click on a link above the scroller. You cannot see it now because its display is set to none.
</div>Use as many as you need. Give them each a unique id and put whatever text and links inside them that you like. Be sure to keep the 'style="display:none"' attribute for each one. Now we are ready to go, here are two example links for switching the contents of the scroller:

<a href="#" onclick="switchConts('content2');return false;">switch</a>&nbsp;
<a href="#" onclick="switchConts('content');return false;">switch back</a>These can go above the scroller, like in your picture.