Sexo: Masculino
Mensajes: 338
|
Hola Luis, no se si te sonará este script, es el mismo que en el bloque contentslider:
Código 
<script type="text/javascript">
<!--
function initImage(id) {
image = document.getElementById(id);
setOpacity(image, 0);
image.style.visibility = "visible";
fadeIn(id,0);
}
function fadeIn(objId,opacity) {
if (document.getElementById) {
obj = document.getElementById(objId);
if (opacity <= 100) {
setOpacity(obj, opacity);
opacity += 10;
window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
}
}
}
function setOpacity(obj, opacity) {
opacity = (opacity == 100)?99.999:opacity;
// IE/Win
obj.style.filter = "alpha(opacity:"+opacity+")";
// Safari<1.2, Konqueror
obj.style.KHTMLOpacity = opacity/100;
// Older Mozilla and Firefox
obj.style.MozOpacity = opacity/100;
// Safari 1.2, newer Firefox and Mozilla, CSS3
obj.style.opacity = opacity/100;
}
// -->
</script>
El caso, es, que quiero aplicarlo en este script, para que cuando clicke en una tabla, haga un fading.
Este es el script de la tabla:
Código 
//** Tab Content script v2.0- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
//** Updated Oct 7th, 07 to version 2.0. Contains numerous improvements:
// -Added Auto Mode: Script auto rotates the tabs based on an interval, until a tab is explicitly selected
// -Ability to expand/contract arbitrary DIVs on the page as the tabbed content is expanded/ contracted
// -Ability to dynamically select a tab either based on its position within its peers, or its ID attribute (give the target tab one 1st)
// -Ability to set where the CSS classname "selected" get assigned- either to the target tab's link ("A"), or its parent container
////NO NEED TO EDIT BELOW////////////////////////
function ddtabcontent(tabinterfaceid){
this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container
this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container
this.enabletabpersistence=true
this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container
this.subcontentids=[] //Array to store ids of the sub contents ("rel" attr values)
this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values)
this.selectedClassTarget="link" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link")
}
ddtabcontent.getCookie=function(Name){
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[0] //return its value
return ""
}
ddtabcontent.setCookie=function(name, value){
document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)
}
ddtabcontent.prototype={
expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers
this.cancelautorun() //stop auto cycling of tabs (if running)
var tabref=""
try{
if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr
tabref=document.getElementById(tabid_or_position)
else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr
tabref=this.tabs[tabid_or_position]
}
catch(err){alert("Invalid Tab ID or position entered!")}
if (tabref!="") //if a valid tab is found based on function parameter
this.expandtab(tabref) //expand this tab
},
setpersist:function(bool){ //PUBLIC function to toggle persistence feature
this.enabletabpersistence=bool
},
setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link")
this.selectedClassTarget=objstr || "link"
},
getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to
return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref
},
expandtab:function(tabref){
var subcontentid=tabref.getAttribute("rel") //Get id of subcontent to expand
//Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easily search through
var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
this.expandsubcontent(subcontentid)
this.expandrevcontent(associatedrevids)
for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"
this.getselectedClassTarget(this.tabs[c]).className=(this.tabs[c].getAttribute("rel")==subcontentid)? "selected" : ""
}
if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers
ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition)
},
expandsubcontent:function(subcontentid){
for (var i=0; i<this.subcontentids.length; i++){
var subcontent=document.getElementById(this.subcontentids[c]) //cache current subcontent obj (in for loop)
subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value
}
},
expandrevcontent:function(associatedrevids){
var allrevids=this.revcontentids
for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface
//if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it
document.getElementById(allrevids[c]).style.display=(associatedrevids.indexOf(","+allrevids[c]+",")!=-1)? "block" : "none"
}
},
autorun:function(){ //function to auto cycle through and select tabs based on a set interval
var currentTabIndex=this.automode_currentTabIndex //index within this.hottabspositions to begin
var hottabspositions=this.hottabspositions //Array containing position numbers of "hot" tabs (those with a "rel" attr)
this.expandtab(this.tabs[hottabspositions[currentTabIndex]])
this.automode_currentTabIndex=(currentTabIndex<hottabspositions.length-1)? currentTabIndex+1 : 0 //increment currentTabIndex
},
cancelautorun:function(){
if (typeof this.autoruntimer!="undefined")
clearInterval(this.autoruntimer)
},
init:function(automodeperiod){
var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled)
var persisterror=true //Bool variable to check whether persisted tab position is valid (can become invalid if user has modified tab structure)
this.automodeperiod=automodeperiod || 0
for (var i=0; i<this.tabs.length; i++){
this.tabs[c].tabposition=i //remember position of tab relative to its peers
if (this.tabs[c].getAttribute("rel")){
var tabinstance=this
this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers
this.subcontentids[this.subcontentids.length]=this.tabs[c].getAttribute("rel") //store id of sub content ("rel" attr value)
this.tabs[c].onclick=function(){
tabinstance.expandtab(this)
tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
return false
}
if (this.tabs[c].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element
this.revcontentids=this.revcontentids.concat(this.tabs[c].getAttribute("rev").split(/\s*,\s*/))
}
if (this.enabletabpersistence && parseInt(persistedtab)==i || !this.enabletabpersistence && this.getselectedClassTarget(this.tabs[c]).className=="selected"){
this.expandtab(this.tabs[c]) //expand current tab if it's the persisted tab, or if persist=off, carries the "selected" CSS class
persisterror=false //Persisted tab (if applicable) was found, so set "persisterror" to false
//If currently selected tab's index(i) is greater than 0, this means its not the 1st tab, so set the tab to begin in automode to 1st tab:
this.automode_currentTabIndex=(i>0)? 0 : 1
}
}
} //END for loop
if (persisterror) //if an error has occured while trying to retrieve persisted tab (based on its position within its peers)
this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr
if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){
this.automode_currentTabIndex=this.automode_currentTabIndex || 0
this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)
}
} //END int() function
} //END Prototype assignment
Y este es el del contenido de esta:
Código 
<ul id="countrytabs" class="shadetabs">
<?php
echo "<li><a href=\"#\" rel=\"country4\" class=\"selected\"><font style=\"font-size: 9px;\">$Nomb</font></a></li>";
?>
<li><a href="#" rel="country1" class="selected">Recomendar</a></li>
<li><a onClick="initImage('country2');" href="#" rel="country2">Recibir nuevas </a></li>
<li><a href="#" rel="country3">Puntuar </a></li>
<li><a href="#" rel="country5">Publicitar</a></li>
<li><a href="#" rel="country6">Compartir</a></li>
<li><a href="javascript:agregara()">Favorito</a></li>
</ul>
<div style="background: url(http://www.zptweb.net/images/tbj.jpg);border:1px solid gray; width:680px; margin-bottom: 1em; padding: 10px">
<div id="country1" class="tabcontent">
<div align="left">
<form method='post' action='http://www.zptweb.net/recomsn.php?accion=envi' name='recomienda'>
Tu Nombre: <input type='text' name='n_remitente' size='20'><br>
Tu E-mail: <input type='text' name='e_remitente' size='21'><br>
Nombre de tu amigo: <input type='text' name='n_destinatario' size='12'><br>
E-mail de tu amigo: <input type='text' name='e_destinatario' size='13'><br>
<?php
$transfertitle = str_replace (" ", "-", $Nomb);
echo "<textarea name='msj' cols='79' rows='5'>Hola te recomiendo este sitio llamado Zptweb, yo estoy en esta sección:
http://www.zptweb.net/$transfertitle-ver-animacion-$id-animaciones-flash.html
La web se llama: http://www.zptweb.net
Saludos.</textarea></div>";?>
<center><input type='submit' class="sub" value='Recomendar'></center>
</form>
</div>
<div onLoad="initImage('country6');" id="country6" class="tabcontent">
<?php
echo"<table align='center'><tr><td><div align='justify'><a href='http://meneame.net/submit.php?url=$promocion'><img src='http://www.zptweb.net/images/promocion/meneame.gif'>Meneame</a><br> <a href='http://barrapunto.com/submit.pl?story=$promocion'><img src='http://www.zptweb.net/images/promocion/barrapunto.gif'>Barrapunto</a><br> <a href='http://www.google.com/bookmarks/mark?op=edit&bkmk=$promocion&title=$Nomb'><img src='http://www.zptweb.net/images/promocion/google.gif'>Google Bookmarks</a><br> <a href='http://del.icio.us/post?url=$promocion&title=$Nomb'><img src='http://www.zptweb.net/images/promocion/icio.gif'>del.icio.us</a><br> <a href='http://www.technorati.com/faves?add=$promocion'><img src='http://www.zptweb.net/images/promocion/technorati.gif'>Technorati</a><br> <a href='http://www.blogmemes.com/post.php?url=$promocion&title=$Nomb'><img src='http://www.zptweb.net/images/promocion/blogmemes.gif'>BlogMemes</a><br> <a href='http://www.neodiario.net/submit.php?url=$promocion'><img src='http://www.zptweb.net/images/promocion/neodiario.gif'>Neodiario</a></td><br> <td><a href='http://digg.com/submit?phase=2&url=$promocion&title=$Nomb'><img src='http://www.zptweb.net/images/promocion/digg.gif'>Digg</a><br> <a href='http://myweb2.search.yahoo.com/myresults/bookmarklet?u=$promocion&t=$Nomb'><img src='http://www.zptweb.net/images/promocion/yahoo.gif'>Yahoo! My Web</a><br> <a href='http://www.newsvine.com/_wine/save?u=$promocion&h=$Nomb'><img src='http://www.zptweb.net/images/promocion/newsvine.gif'>Newsvine</a><br> <a href='http://tec.fresqui.com/post?url=$promocion&title=$Nomb'><img src='http://www.zptweb.net/images/promocion/fresqui.gif'>Fresqui</a><br> <a href='http://es.blinklist.com/index.php?Action=Blink/addblink.php&Url=$promocion&Title=$Nomb'><img src='http://www.zptweb.net/images/promocion/blinklist.gif'>Blinklist</a><br> <a href='http://enchilame.com/submit.php?url=$promocion'><img src='http://www.zptweb.net/images/promocion/enchilame.gif'>Enchilame</a></b></font></font></div></td></tr></table>";
?>
</div>
<div id="country2" class="tabcontent">
<div align="center">
<form action="http://www.feedburner.com/fb/a/emailverify" method="post" target="popupwindow" onsubmit="window.open('http://www.feedburner.com/fb/a/emailverifySubmit?feedId=1469603', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true"><input class='mail' src='images/icon_send.png' type="text" value="Nuevas animaciones por mail" name="email" onfocus="if (this.value == 'Nuevas animaciones por mail') this.value = ''"/><input type="hidden" value="http://feeds.feedburner.com/~e?ffid=1469603" name="url"/><input type="hidden" value="Zptweb animaciones flash" name="title"/><input type="hidden" name="loc" value="es_ES"/> <input class="sub" type="submit" heigth='20' value="Subscribirse" /></form>
<br><br><img src="http://www.zptweb.net/images/rssd.gif"><a href="http://feeds.feedburner.com/ZptwebAnimacionesFlash">RSS Animaciones</a></div></div>
<div id="country5" class="tabcontent">
<?php
echo "<div align='center'><br><span style='font-size: 10px;'>Quieres insertar esta animación en tu web/blog?<br><form onclick=\"javascript:SeleccionarTextArea(0)\" id='AreaDeTexto' method='post' action='' style='text-align:center'><textarea readonly='true' rows='3' name=\"TextoEnArea\" cols='60'><a href='$promocion'>$Nomb</a></textarea></form></div></center>";
?>
</div>
<div id="country3" class="tabcontent">
<div align="center">
<form name="form1" method="post" action="<?php echo "modules.php?name=$module_name&file=votar";?>">
<table>
<td heigth="20"><div align="center"><strong>
<select name="puntos" id="puntos">
<option value="10">10</option>
<option value="9">9</option>
<option value="8">8</option>
<option value="7">7</option>
<option value="6">6</option>
<option value="5">5</option>
<option value="4">4</option>
<option value="3">3</option>
<option value="2">2</option>
<option value="1">1</option>
</select>
</div></td>
<td height="20">
<input name="voto" type="submit" id="voto" Value="Puntuar">
<input name="animacion" type="hidden" id="animacion" value="<?php echo "$animacion";?>">
</div></table>
</div>
</div>
<div id="country4" class="tabcontent">
<?php
echo "<div align='center'><center><strong>$Nomb</strong><br>";
echo "<img onLoad=\"initImage('country4');\" id=\"country4\" src='$Img'><br><hr>$Descr<br><a href='$Swf'><img src='http://www.zptweb.net/modules/Downloads/images/down.jpg'><strong>Descargar $Nomb gratis!</a></strong><div style=\"float:right\"><font style=\"font-size: 9px;\">Se ha visto $Hits veces.</font></div>";
?>
</div>
<script type="text/javascript">
var countries=new ddtabcontent("countrytabs")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()
</script>
<script type="text/javascript">
var mypets=new ddtabcontent("pettabs")
mypets.setpersist(false)
mypets.setselectedClassTarget("link")
mypets.init(2000)
</script>
Yo ya lo he intentado mucho, pero no me sale, solo cuando carga por primera vez.
Saludos.
|