This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > February 2006 > Controlling Layer Scrolling





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Controlling Layer Scrolling
edelhart@manateebay.com

2006-02-28, 6:21 pm

I have a layer with a scrollbar and I want to have it scrolled to a
specific place when the page loads. I would ideally want to do this
with CSS, but if I have to, with JS. Any ideas?

**************** CODE **********************

<style>
..dal_groupset_list
{
overflow: scroll;
height: 120px;
}

</style>

<div class="dal_groupset_list" id="<{$dal_form }>_dal_groupset_list"
style="scrollTop: <{$dal_scroll}>">

<!--- many lines of content -->

</div>
<script language="javascript">
xoopsSetElementProp('<{$dal_form }>_dal_groupset_list',
'scrollTop',
'<{$dal_scroll}>');

function xoopsGetElementById(id){
if (document.getElementById) {
return (document.getElementById(id));
} else if (document.all) {
return (document.all[id]);
} else {
if ((navigator.appname.indexOf("Netscape") != -1) &&
parseInt(navigator.appversion == 4)) {
return (document.layers[id]);
}
}

}

function xoopsSetElementProp(name, prop, val) {
var elt=xoopsGetElementById(name);
if (elt) elt[prop]=val;
}

</script>

****************** END CODE ********************

(the <{ }> elements are server side SMARTY includes.
$dal_scroll is an integer.
$dal_form is a string.
)

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews