rmachado
01-27-2009, 05:06 PM
1) Script Title:
Multi-part content script
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/multipartcontent.htm
3) Describe problem:
Actually there are 2 problems.
When is that I can't manage to make the script to work properly in FF
The second is a bouncing link that I also can't fix.
See the example in (portuguese site):
http://www.petiscos.com/receita.php?recid=3536&catid=7
The script is located in were the curved arrow is, see "Receitas Sugeridas".
The code is:
if (document.getElementById){
document.write('<style type="text/css">')
document.write('.multiparts, #formnavigation{display:none;}')
document.write('</style>')
}
var curpart=0
function getElementbyClass(classname){
partscollect=new Array()
var inc=0
var alltags=document.all ? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
partscollect[inc++]=alltags[i]
}
}
function cycleforward(){
partscollect[curpart].style.display="none"
curpart=(curpart<partscollect.length-1)? curpart+1 : 0
partscollect[curpart].style.display="block"
updatenav()
}
function cycleback(){
partscollect[curpart].style.display="none"
curpart=(curpart>0)? curpart-1 : partscollect.length-1
partscollect[curpart].style.display="block"
updatenav()
}
function updatenav(){
//document.getElementById("backbutton").style.visibility=(curpart==0)? "hidden" : "visible"
document.getElementById("forwardbutton").style.visibility=(curpart==partscollect.length-1)? "hidden" : "visible"
}
function onloadfunct(){
getElementbyClass("multiparts")
partscollect[0].style.display="block"
document.getElementById("formnavigation").style.display="block"
updatenav()
}
if (window.addEventListener)
window.addEventListener("load", onloadfunct, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunct)
else if (document.getElementById)
window.onload=onloadfunct
and:
.multiparts{
height: 50px;
width: 280px;
<td align="right" class="texto10castanho">
<div id="formnavigation" style="width:180px; display:none">
<a id="forwardbutton" href="javascript:cycleforward()">Ver mais receitas sugeridas</a>
</div></td>
So How can I fix them?
Thanks
Multi-part content script
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/multipartcontent.htm
3) Describe problem:
Actually there are 2 problems.
When is that I can't manage to make the script to work properly in FF
The second is a bouncing link that I also can't fix.
See the example in (portuguese site):
http://www.petiscos.com/receita.php?recid=3536&catid=7
The script is located in were the curved arrow is, see "Receitas Sugeridas".
The code is:
if (document.getElementById){
document.write('<style type="text/css">')
document.write('.multiparts, #formnavigation{display:none;}')
document.write('</style>')
}
var curpart=0
function getElementbyClass(classname){
partscollect=new Array()
var inc=0
var alltags=document.all ? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
partscollect[inc++]=alltags[i]
}
}
function cycleforward(){
partscollect[curpart].style.display="none"
curpart=(curpart<partscollect.length-1)? curpart+1 : 0
partscollect[curpart].style.display="block"
updatenav()
}
function cycleback(){
partscollect[curpart].style.display="none"
curpart=(curpart>0)? curpart-1 : partscollect.length-1
partscollect[curpart].style.display="block"
updatenav()
}
function updatenav(){
//document.getElementById("backbutton").style.visibility=(curpart==0)? "hidden" : "visible"
document.getElementById("forwardbutton").style.visibility=(curpart==partscollect.length-1)? "hidden" : "visible"
}
function onloadfunct(){
getElementbyClass("multiparts")
partscollect[0].style.display="block"
document.getElementById("formnavigation").style.display="block"
updatenav()
}
if (window.addEventListener)
window.addEventListener("load", onloadfunct, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunct)
else if (document.getElementById)
window.onload=onloadfunct
and:
.multiparts{
height: 50px;
width: 280px;
<td align="right" class="texto10castanho">
<div id="formnavigation" style="width:180px; display:none">
<a id="forwardbutton" href="javascript:cycleforward()">Ver mais receitas sugeridas</a>
</div></td>
So How can I fix them?
Thanks