PDA

View Full Version : Javascript Error: Object required line 71



WebSmart
05-05-2009, 08:34 AM
1) Script Title:
Virtual Pagination script v2.0
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/virtualpagination.htm
3) Describe problem:

Javascript Error: Object required line 71 Char 2


<div id="tcontent1" class="tabcontent">
<div id="gallerypaginate2" class="paginationstyle"></div>

<div style="width: 300px;">

<div class="virtualpages hidepiece">
<img name="curry" src="images/curry.png" width="700" height="375" border="0" id="curry" usemap="#m_curry" alt="" /><map name="m_curry" id="m_curry">
<area shape="rect" coords="650,39,690,342" href="javascript:gallerys.navigate(1)" alt="" />
</map>
</div>

<div class="virtualpages hidepiece">
<img name="curry2" src="images/curry2.png" width="700" height="375" border="0" id="curry2" usemap="#m_curry2" alt="" /><map name="m_curry2" id="m_curry2">
<area shape="rect" coords="650,39,690,342" href="javascript:gallerys.navigate(0)" alt="" />
</map>
</div>

<script type="text/javascript">

var gallerys=new virtualpaginate2({
piececlass2: "virtualpages", //class of container for each piece of content
piececontainer2: 'div', //container element type (ie: "div", "p" etc)
pieces_per_page2: 1, //Pieces of content to show per page (1=1 piece, 2=2 pieces etc)
defaultpage2: 0, //Default page selected (0=1st page, 1=2nd page etc). Persistence if enabled overrides this setting.
persist2: false //Remember last viewed page and recall it when user returns within a browser session?
})

gallerys.buildpagination2(["gallerypaginate", "gallerypaginate2"])

</script>

</div>

ddadmin
05-05-2009, 04:51 PM
There may be other issues, but just based on the above code, you shouldn't be changing the individual setting variable names, even if you're displaying multiple instances of the script on a page. In other words, the parts in red below should be removed:


var gallerys=new virtualpaginate2({
piececlass2: "virtualpages", //class of container for each piece of content
piececontainer2: 'div', //container element type (ie: "div", "p" etc)
pieces_per_page2: 1, //Pieces of content to show per page (1=1 piece, 2=2 pieces etc)
defaultpage2: 0, //Default page selected (0=1st page, 1=2nd page etc). Persistence if enabled overrides this setting.
persist2: false //Remember last viewed page and recall it when user returns within a browser session?
})

gallerys.buildpagination2(["gallerypaginate", "gallerypaginate2"])

Please review the demo code on the script page (http://www.dynamicdrive.com/dynamicindex17/virtualpagination.htm) again for the proper syntax.