This is a test page I've put up: http://02ce746.netsolhost.com/tst/a.htm
I am trying to auto-scroll the DIV upon page load. I've tried so many different combinations in script.js that I am about to give up. Anyone could help?
This is a test page I've put up: http://02ce746.netsolhost.com/tst/a.htm
I am trying to auto-scroll the DIV upon page load. I've tried so many different combinations in script.js that I am about to give up. Anyone could help?
try enclosing your script in $(document).ready(){}
$(document).ready( function(){
$('div.scrollcontainer').serialScroll({interval:'1',axis:'y'});
});
You just need to set force = true, which will force an initial scroll event:
$(document).ready( function(){
$('div.scrollcontainer').serialScroll({force:true});
});
From the plugin site:
This plugin allows you to easily animate any series of elements, by sequentially scrolling them.
I think the plugin scrolls through a set of elements and you have only on element in your container. May be you should separate the text in paragraphs...
Please have a look at this, it works:
<style type="text/css">
._container{clear:left;height:120px;margin:10px 0 0 10px; overflow:hidden;
position:relative;width:220px;}
ul{height:1011px;width:1820px;background-color:#5B739C;list-style-image:none;
list-style-position:outside;list-style-type:none;margin:0;padding:0;}
li{background-color:#DDDDDD;border:1px solid black;font-weight:bolder;
height:100px;padding:50px;position:relative;text-align:center;width:200px;
list-style-image:none;list-style-position:outside;
list-style-type:none;margin:0;}
</style>
<div id="container" class="_container">
<ul>
<li><p>0</p></li> <li><p>1</p></li> <li><p>2</p></li> <li><p>3</p></li>
<li><p>4</p></li> <li><p>5</p></li> <li><p>6</p></li> <li><p>7</p></li>
<li><p>7</p></li> <li><p>8</p></li> <li><p>9</p></li> <li><p>10</p></li>
<li><p>11</p></li> <li><p>12</p></li> <li><p>13</p></li> <li><p>14</p></li>
</ul>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("div#container").serialScroll({items:'li', duration:2000,
force:true, axis:'y', easing:'linear',
lazy:true, interval:1, step:1 });
});
</script>