رفتن به مطلب

مشکل با دو جکوئری


پست های پیشنهاد شده

سلام

من توی سایتم در دو قسمت از منوی تب دار استفاده کردم. که برای هر کدوم از اونها یکی از این فایلها لازمه:

jquery.js

jquery-1.7.2.min.js

وقتی از هر دو استفاده می کنم یکی از منوهای تب دار از کار میافته و باید یکی از این دو تا رو حذف کنم. ولی من میخوام از هر دو منو استفاده کنم. چیکار میشه کرد؟

لینک به ارسال

کدهای بخش مربوط به فراخوانی پلاگین های جی کوئری + کدهای منوهای تب دارتون رو قرار بدید .

لینک به ارسال

کد استایل منوی A:


<style>
ul.tabs {
margin: 0;
padding: 0;
float: right;
list-style: none;
height: 32px;
width: 100%;
font:12px tahoma;
}
ul.tabs li {
float: right;
margin: 0;
cursor: pointer;
padding: 0px 21px ;
height: 31px;
line-height: 31px;
border: 1px solid #999;
border-right:none;
font-weight: bold;
background: #EEE;
overflow: hidden;
position: relative;
}
ul.tabs li:hover {
background: #CCCCCC;
}
ul.tabs li:first-child{
border-radius:0 5px 0 0;
-moz-border-radius:0 5px 0 0;
-ms-border-radius:0 5px 0 0;
-webkit-border-radius:0 5px 0 0;
-o-border-radius:0 5px 0 0;
-khtml-border-radius:0 5px 0 0;
border-right:1px solid #999;
}
ul.tabs li:last-child{
border-radius:5px 0 0 0;
-moz-border-radius:5px 0 0 0;
-ms-border-radius:5px 0 0 0;
-webkit-border-radius:5px 0 0 0;
-o-border-radius:5px 0 0 0;
-khtml-border-radius:5px 0 0 0;
}
ul.tabs li.active{
background: #FFF;
border-bottom: 1px solid #FFF;
}
.alltabs {
border: 1px solid #999;
clear: both;
float: right;
width: 100%;
background: #FFF;
border-radius:5px 0 5px 5px;
-moz-border-radius:5px 0 5px 5px;
-ms-border-radius:5px 0 5px 5px;
-webkit-border-radius:5px 0 5px 5px;
-o-border-radius:5px 0 5px 5px;
-khtml-border-radius:5px 0 5px 5px;
}
.tab {
padding: 10px;
font:11px tahoma;
text-align:right;
display: none;
}
</style>

اسکریپت منوی A:


<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
$(document).ready(function() {
$(".tab").slideUp();
$(".tab:first").slideDown();
$("ul.tabs li").click(function() {
$("ul.tabs li").removeClass("active");
$(this).addClass("active");
$(".tab").slideUp();
var activeTab = $(this).attr("rel");
$("#"+activeTab).slideToggle();
});
});
</script>

کد منوی A:


<ul class="tabs">

<li class="active" rel="tabbed-box01">U†?±U… ?§U??²?§?± U…Uˆ?¨?§UŒU„</li>
<li rel="tabbed-box02">EC?? ??EC??</li>
<li rel="tabbed-box03">??CE? ??? ????</li>
<li rel="tabbed-box04">?I ? CE?C? ?C?E</li>
</ul>
<div class="alltabs">
<div id="tabbed-box01" class="tab">
<?php $myposts = get_posts('category=227&numberposts=4'); ?>
<?php foreach($myposts as $post) : setup_postdata($post); ?>
<li><h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> [<?php echo the_date('d M Y'); ?>] </li>
<img height="70" width="100" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" src="<?php echo catch_that_image(); ?>">
<?php endforeach; ?>
<div class="left"><a href="<?php echo get_category_link( 227 ); ?>" ><span style="background: transparent url(/wp-content/themes/DBStheme_Kelishe/images/jarage.gif) repeat-x scroll 0% 0%; color: #00bb35; text-shadow: 0px 0px 1px;">[?¢?±?´U?Uˆ]</span></a></div>
</div>
</div>
<div id="tabbed-box02" class="tab">
<?php $myposts = get_posts('category=217&numberposts=4'); ?>
<?php foreach($myposts as $post) : setup_postdata($post); ?>
<li><h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> [<?php echo the_date('d M Y'); ?>] </li>
<img height="70" width="100" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" src="<?php echo catch_that_image(); ?>">
<?php endforeach; ?>
<div class="left"><a href="<?php echo get_category_link( 217 ); ?>" ><span style="background: transparent url(/wp-content/themes/DBStheme_Kelishe/images/jarage.gif) repeat-x scroll 0% 0%; color: #00bb35; text-shadow: 0px 0px 1px;">[?¢?±?´U?Uˆ]</span></a></div>
</div>
</div>
<div id="tabbed-box03" class="tab">
<?php $myposts = get_posts('category=223&numberposts=4'); ?>
<?php foreach($myposts as $post) : setup_postdata($post); ?>
<li><h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> [<?php echo the_date('d M Y'); ?>] </li>
<img height="70" width="100" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" src="<?php echo catch_that_image(); ?>">
<?php endforeach; ?>
<div class="left"><a href="<?php echo get_category_link( 223 ); ?>" ><span style="background: transparent url(/wp-content/themes/DBStheme_Kelishe/images/jarage.gif) repeat-x scroll 0% 0%; color: #00bb35; text-shadow: 0px 0px 1px;">[?¢?±?´U?Uˆ]</span></a></div>
</div>
</div>
<div id="tabbed-box04" class="tab">
<?php $myposts = get_posts('category=214&numberposts=10'); ?>
<?php foreach($myposts as $post) : setup_postdata($post); ?>
<li><h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> [<?php echo the_date('d M Y'); ?>] </li>
<?php endforeach; ?>
<div class="left"><a href="<?php echo get_category_link( 214 ); ?>" ><span style="background: transparent url(/wp-content/themes/DBStheme_Kelishe/images/jarage.gif) repeat-x scroll 0% 0%; color: #00bb35; text-shadow: 0px 0px 1px;">[?¢?±?´U?Uˆ]</span></a></div>
</div>
</div>
</div>
</div>

**************

اسکریپت منوی B:


<script language="javascript" type="text/javascript" src="http://kingblog.ir/kb/wp-content/themes/DBStheme_Kelishe/jquery.js"></script>

کد منوی B:


<div class="wa-clear"></div>
<div id="tabco4">
<ul id="tabs">
<li><a href="javascript:vd()">آخرین مطالب وبلاگها </a></li>
<li><a href="javascript:vd()">وبلاگهای برتر</a></li>
<li><a href="javascript:vd()">برندگان این ماه</a></li>
<li><a href="javascript:vd()">وبلاگ های بروز شده</a></li>
</ul>
<div class="tabbed-content">
<ul>
<?php
$updates = get_last_updated(' ', 0, 10);
foreach($updates as $up){
if ( 0 == $up['blog_id'] || 1 == $up['blog_id'] )
$post_prefix= $table_prefix .'posts';
else
$post_prefix = $table_prefix . $up['blog_id'] . '_posts';
$post = $wpdb->get_results($wpdb->prepare("SELECT `post_title`,`ID` FROM `$post_prefix` WHERE `post_status`='publish' AND`post_type`='post' ORDER BY `ID` DESC LIMIT 1;"));
if(is_object($post[0]))
printf('<li><a href="%s" title="%s">%2$s</a></li>',get_blog_option( $up['blog_id'],'siteurl').'/?p='.$post[0]->ID ,$post[0]->post_title);
}
?>
</ul> </div>
<div class="tabbed-content">
در این قسمت وبلاگ های برتر را خواهید دید.
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('bartar') ) ?>
</div>
<div class="tabbed-content">
برندگان این ماه:
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('barande') ) ?>
</div>
<div class="tabbed-content">
<?php
$blogs = get_last_updated();
if( is_array( $blogs ) ) {
?>

<?php foreach( $blogs as $details ) {
?><div><a href="http://<?php echo $details[ 'domain' ] . $details[ 'path' ] ?>"><?php echo get_blog_option(
$details[ 'blog_id' ], 'blogname' ) ?></a></div><?php
$i++;
if($i==9)
break;
}
?>

<?php
}
?> </div>

</div>

استایل منوی B:


#tabco4 {
-webkit-border-radius: 7px;
-moz-border-radius:7px;
border-radius: 7px;
behavior: url(PIE.htc);
border: 1px solid #C6C6C6;
}
#tabco4 #tabs li {
list-style: none;
float: right;
}
#tabco4 #tabs li a {
height:16px;
display: block;
width: 130px;
padding: 7px 0;
font-weight: bold;
font-family: 'KulminoituvaRegular', helvetica, sans-serif;
text-align: center;
text-decoration: none;
background: #fff url(images/mozo-h.jpg) repeat-x ;
border-right: 1px solid #ddd;
border-bottom: 1px solid #ddd;
-webkit-transition:All .5s ease-out;
-moz-transition:All .500s ease;
-o-transition:All .500s ease;
-webkit-transform: rotate(-3deg) scale(1.2);
-moz-transform: rotate(-3deg) scale(1.2);
-o-transform: rotate(-3deg) scale(1.2);
border-radius: 3px;
}
#tabco4 #tabs li:first-child a {
border-right: none; }
#tabco4 #tabs li a:hover {
color: #333; }
#tabco4 #tabs li a:focus {
outline: none; }
#tabco4 #tabs li a.active, #tabco4 #tabs li a.active:hover {
color: #333;
background: #fff url(images/mozo-ah.jpg) repeat-x ;
border-bottom: 1px solid #fff; }

لینک به ارسال

وقتی از این کد استفاده میکنم:


<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>

منوی B کار نمیکنه.و وقتی برش میدارم منوی A کار نمیکنه

در ضمن از این اسکریپت هم برای منوی B استفاده میکنم:

//---------------------------------

window.onload = function(){

init()

}

var containercolor="";

function init() {

var border="#cfcfcf 1px solid";

var conbkcolor="#eee9e9";

var tabbk="#cfcfcf";

t4 = new Bindtabs("tabco4",0,"mouseover","t",border,tabbk,conbkcolor,"400px");

t4.c();

}

function vd() {

}

function tabEvent(evt) {

evt = (evt) ? evt : ((window.event) ? window.event : "");

if (evt) {

var elem = getTargetElement(evt);

var actContainer = (elem.tagName=='A') ? elem.parentNode.parentNode.parentNode.id : elem.parentNode.parentNode.id;

var tp = gettab(actContainer).position;

var hvelem = (elem.tagName=='A') ? elem.parentNode : elem;

var lielem = (elem.tagName=='A') ? elem.parentNode.parentNode.getElementsByTagName('li') : elem.parentNode.getElementsByTagName('li');

if ((evt.type == "mouseover") || (evt.type == "click")) {

actIndex = getIndex(lielem,hvelem);

if (actIndex==undefined) return;

showContent(actContainer,actIndex);

}

}

}

function getIndex(arry,elem) {

for (var i=0; i < arry.length; i++) {

if (arry == elem) {

return i;

}

}

}

function showContent(container,act) {

var contDiv = new Array;

var j =0;

var tab = gettab(container);

var tp = tab.position;

var vborder = tab.border;

var vboxwidth = tab.width;

var vtabcolor =tab.tabcolor;

var contDiv0 = $$($(container),('div'));

for(var i=0; i<contDiv0.length; i++){

if (contDiv0.parentNode.id==container) {

contDiv[j] = contDiv0;

j = j+1;

}

}

contDiv[act].className = "content";

var vbkcolor = getbkColor(contDiv[act]);

var tagul = getUL(container,tp);

var tagula = $$(tagul,('a'));

var tagulli = $$(tagul,('li'));

for(var i=0; i<tagula.length; i++){

tagula.className="ula";

}

for(var i=0; i<tagulli.length; i++){

tagulli.className="ullifloat";

}

tagul.className= "ulnofloat";

$(container).style.borderRight = (ie6()==true) ? containercolor +" 0px solid" : containercolor +"";

contDiv[act].style.display = "block";

for(var i=0; i<contDiv.length; i++){

if (i != act) {

contDiv.style.display = "none";

}

}

var actitem = tagulli[act];

var actitema = $$(actitem,('a'))[0];

actitema.style.top ="1px";

actitem.style.borderTop = vborder;

actitema.style.backgroundColor =vbkcolor;

var marginRight_li = getmarginRight(actitem);

var marginBottom_li = getmarginBottom(actitem);

for(var i=0; i<tagulli.length; i++){

if (marginRight_li=="0px") {

tagulli.style.borderLeft = (i==0) ? vborder : "#fff 0px";

}

if (i != act) {

var a = $$(tagulli,'a')[0];

a.style.top ="0px";

a.style.left ="0px";

a.style.backgroundColor =vtabcolor;

tagulli.style.borderTop = vborder;

}

}

}

function bindEvent(container, e) {

var tp = gettab(container).position;

var ele = $$(getUL(container,tp),'li');

for(var i=0; i<ele.length; i++){

if (e=="click") {

ele.onmouseover ="";

ele.onclick = tabEvent;

}

if (e=="mouseover") {

ele.onmouseover = tabEvent;

}

}

}

function Bindtabs(id,activetab1,eventType,position,border,tabcolor,bkcolor,width) {

this.id = id;

this.activetab1 = activetab1;

this.eventType = eventType;

this.position = position;

this.border =border;

this.tabcolor=tabcolor;

this.bkcolor=bkcolor;

this.width = width;

this.c = function () {

showContent(this.id,this.activetab1);

bindEvent(this.id,this.eventType);

}

}

function getUL(id,ttp) {

if ((ttp=="t") || (ttp=="l") ||(ttp=="p")) {

var ul = $$($(id),('ul'))[0];

}

else

{

var n = $$($(id),('ul')).length;

var ul = $$($(id),('ul'))[n-1];

}

return ul;

}

function gettab(id) {

return (id=="tabco4") ? t4 : t1;

}

function ie6() {

var appVer = navigator.appVersion.toLowerCase();

var iePos = appVer.indexOf('msie');

if (iePos !=-1) {

is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))

is_major = parseInt(is_minor);

}

var is_ie = ((iePos!=-1));

var is_ie6 = (is_ie && is_major == 6);

return is_ie6;

}

function getmarginBottom(obj) {

return (obj.currentStyle) ? obj.currentStyle.marginBottom : getComputedStyle(obj,'').getPropertyValue('margin-bottom');

}

function getmarginRight(obj) {

return (obj.currentStyle) ? obj.currentStyle.marginRight : getComputedStyle(obj,'').getPropertyValue('margin-right');

}

function getbkColor(obj) {

return (obj.currentStyle) ? obj.currentStyle.backgroundColor : getComputedStyle(obj,'').getPropertyValue('background-color');

}

function getTargetElement(evt) {

return (evt.target) ? ((evt.target.nodeType == 3) ? evt.target.parentNode : evt.target) : evt.srcElement;

}

function $(id){ return(document.getElementById(id)); }

function $$(e,tag) {return e.getElementsByTagName(tag);}

ویرایش شده توسط Morteza
لینک به ارسال

کدهاتون ظاهرا نباید تداخل کنه

از یکی از

jquery.js

jquery-1.7.2.min.js

قبل از کدهای هر دو تب استفاده کنید کافی ست

لینک به ارسال

ممنون ولی این کار رو کردم فایده نداره. الان با یک فایل جی کوئری کار میکنه و تداخلش رو پیدا کردم. وقتی فایل tabmenu.js که مربوط به منوی دیگه هست رو حذف میکنم منوی دومی درست میشه ولی خب منوی قبلی خراب میشه و وقتی باشه، برعکس یعنی منوی قبلی درست میشه ولی منوی دیگه خراب میشه.

این محتویات فایل tabmenu.js هست:

//---------------------------------

window.onload = function(){

init()

}

var containercolor="";

function init() {

var border="#cfcfcf 1px solid";

var conbkcolor="#eee9e9";

var tabbk="#cfcfcf";

t4 = new Bindtabs("tabco4",0,"mouseover","t",border,tabbk,conbkcolor,"400px");

t4.c();

}

function vd() {

}

function tabEvent(evt) {

evt = (evt) ? evt : ((window.event) ? window.event : "");

if (evt) {

var elem = getTargetElement(evt);

var actContainer = (elem.tagName=='A') ? elem.parentNode.parentNode.parentNode.id : elem.parentNode.parentNode.id;

var tp = gettab(actContainer).position;

var hvelem = (elem.tagName=='A') ? elem.parentNode : elem;

var lielem = (elem.tagName=='A') ? elem.parentNode.parentNode.getElementsByTagName('li') : elem.parentNode.getElementsByTagName('li');

if ((evt.type == "mouseover") || (evt.type == "click")) {

actIndex = getIndex(lielem,hvelem);

if (actIndex==undefined) return;

showContent(actContainer,actIndex);

}

}

}

function getIndex(arry,elem) {

for (var i=0; i < arry.length; i++) {

if (arry == elem) {

return i;

}

}

}

function showContent(container,act) {

var contDiv = new Array;

var j =0;

var tab = gettab(container);

var tp = tab.position;

var vborder = tab.border;

var vboxwidth = tab.width;

var vtabcolor =tab.tabcolor;

var contDiv0 = $$($(container),('div'));

for(var i=0; i<contDiv0.length; i++){

if (contDiv0.parentNode.id==container) {

contDiv[j] = contDiv0;

j = j+1;

}

}

contDiv[act].className = "content";

var vbkcolor = getbkColor(contDiv[act]);

var tagul = getUL(container,tp);

var tagula = $$(tagul,('a'));

var tagulli = $$(tagul,('li'));

for(var i=0; i<tagula.length; i++){

tagula.className="ula";

}

for(var i=0; i<tagulli.length; i++){

tagulli.className="ullifloat";

}

tagul.className= "ulnofloat";

$(container).style.borderRight = (ie6()==true) ? containercolor +" 0px solid" : containercolor +"";

contDiv[act].style.display = "block";

for(var i=0; i<contDiv.length; i++){

if (i != act) {

contDiv.style.display = "none";

}

}

var actitem = tagulli[act];

var actitema = $$(actitem,('a'))[0];

actitema.style.top ="1px";

actitem.style.borderTop = vborder;

actitema.style.backgroundColor =vbkcolor;

var marginRight_li = getmarginRight(actitem);

var marginBottom_li = getmarginBottom(actitem);

for(var i=0; i<tagulli.length; i++){

if (marginRight_li=="0px") {

tagulli.style.borderLeft = (i==0) ? vborder : "#fff 0px";

}

if (i != act) {

var a = $$(tagulli,'a')[0];

a.style.top ="0px";

a.style.left ="0px";

a.style.backgroundColor =vtabcolor;

tagulli.style.borderTop = vborder;

}

}

}

function bindEvent(container, e) {

var tp = gettab(container).position;

var ele = $$(getUL(container,tp),'li');

for(var i=0; i<ele.length; i++){

if (e=="click") {

ele.onmouseover ="";

ele.onclick = tabEvent;

}

if (e=="mouseover") {

ele.onmouseover = tabEvent;

}

}

}

function Bindtabs(id,activetab1,eventType,position,border,tabcolor,bkcolor,width) {

this.id = id;

this.activetab1 = activetab1;

this.eventType = eventType;

this.position = position;

this.border =border;

this.tabcolor=tabcolor;

this.bkcolor=bkcolor;

this.width = width;

this.c = function () {

showContent(this.id,this.activetab1);

bindEvent(this.id,this.eventType);

}

}

function getUL(id,ttp) {

if ((ttp=="t") || (ttp=="l") ||(ttp=="p")) {

var ul = $$($(id),('ul'))[0];

}

else

{

var n = $$($(id),('ul')).length;

var ul = $$($(id),('ul'))[n-1];

}

return ul;

}

function gettab(id) {

return (id=="tabco4") ? t4 : t1;

}

function ie6() {

var appVer = navigator.appVersion.toLowerCase();

var iePos = appVer.indexOf('msie');

if (iePos !=-1) {

is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))

is_major = parseInt(is_minor);

}

var is_ie = ((iePos!=-1));

var is_ie6 = (is_ie && is_major == 6);

return is_ie6;

}

function getmarginBottom(obj) {

return (obj.currentStyle) ? obj.currentStyle.marginBottom : getComputedStyle(obj,'').getPropertyValue('margin-bottom');

}

function getmarginRight(obj) {

return (obj.currentStyle) ? obj.currentStyle.marginRight : getComputedStyle(obj,'').getPropertyValue('margin-right');

}

function getbkColor(obj) {

return (obj.currentStyle) ? obj.currentStyle.backgroundColor : getComputedStyle(obj,'').getPropertyValue('background-color');

}

function getTargetElement(evt) {

return (evt.target) ? ((evt.target.nodeType == 3) ? evt.target.parentNode : evt.target) : evt.srcElement;

}

function $(id){ return(document.getElementById(id)); }

function $$(e,tag) {return e.getElementsByTagName(tag);}

ویرایش شده توسط Morteza
لینک به ارسال

صفحه اصلی سایتم:

kingblog.ir

یک منو اون وسط صفحه است که شامل 4 گزینه بنام آخرین مطالب وبلاگها،وبلاگهای برتر، برندگان، و وبلاگهای بروز شده است.

منوی دیگه رو که قراره پایین صفحه قرار بگیره حذف کردم که کدهاشو پیوست میکنم.1.rar

لینک به ارسال

ماشاله یکی دو تا خطا نیست

شما فایرباگ رو نصب و بعد تست کنید خودتون هم ببینید :)

لینک به ارسال

ممنون برای پیگیریتون ولی من زیاد وارد نیستم یعنی حل این مشکل واقعا کار من نیست!

شاید اشکال از کلاس یا آی دی tab باشه نمیدونم

لینک به ارسال

دوستان لطفا یکی کمک کنه :(

دو منو دارم که با هم کار نمیکنه. وقتی این کد رو که مال منوی اولی هست رو بر میدارم، منوی دومی درست کار میکنه:

//---------------------------------

window.onload = function(){

init()

}

var containercolor="";

function init() {

var border="#cfcfcf 1px solid";

var conbkcolor="#eee9e9";

var tabbk="#cfcfcf";

t4 = new Bindtabs("tabco4",0,"mouseover","t",border,tabbk,conbkcolor,"400px");

t4.c();

}

function vd() {

}

function tabEvent(evt) {

evt = (evt) ? evt : ((window.event) ? window.event : "");

if (evt) {

var elem = getTargetElement(evt);

var actContainer = (elem.tagName=='A') ? elem.parentNode.parentNode.parentNode.id : elem.parentNode.parentNode.id;

var tp = gettab(actContainer).position;

var hvelem = (elem.tagName=='A') ? elem.parentNode : elem;

var lielem = (elem.tagName=='A') ? elem.parentNode.parentNode.getElementsByTagName('li') : elem.parentNode.getElementsByTagName('li');

if ((evt.type == "mouseover") || (evt.type == "click")) {

actIndex = getIndex(lielem,hvelem);

if (actIndex==undefined) return;

showContent(actContainer,actIndex);

}

}

}

function getIndex(arry,elem) {

for (var i=0; i < arry.length; i++) {

if (arry == elem) {

return i;

}

}

}

function showContent(container,act) {

var contDiv = new Array;

var j =0;

var tab = gettab(container);

var tp = tab.position;

var vborder = tab.border;

var vboxwidth = tab.width;

var vtabcolor =tab.tabcolor;

var contDiv0 = $$($(container),('div'));

for(var i=0; i<contDiv0.length; i++){

if (contDiv0.parentNode.id==container) {

contDiv[j] = contDiv0;

j = j+1;

}

}

contDiv[act].className = "content";

var vbkcolor = getbkColor(contDiv[act]);

var tagul = getUL(container,tp);

var tagula = $$(tagul,('a'));

var tagulli = $$(tagul,('li'));

for(var i=0; i<tagula.length; i++){

tagula.className="ula";

}

for(var i=0; i<tagulli.length; i++){

tagulli.className="ullifloat";

}

tagul.className= "ulnofloat";

$(container).style.borderRight = (ie6()==true) ? containercolor +" 0px solid" : containercolor +"";

contDiv[act].style.display = "block";

for(var i=0; i<contDiv.length; i++){

if (i != act) {

contDiv.style.display = "none";

}

}

var actitem = tagulli[act];

var actitema = $$(actitem,('a'))[0];

actitema.style.top ="1px";

actitem.style.borderTop = vborder;

actitema.style.backgroundColor =vbkcolor;

var marginRight_li = getmarginRight(actitem);

var marginBottom_li = getmarginBottom(actitem);

for(var i=0; i<tagulli.length; i++){

if (marginRight_li=="0px") {

tagulli.style.borderLeft = (i==0) ? vborder : "#fff 0px";

}

if (i != act) {

var a = $$(tagulli,'a')[0];

a.style.top ="0px";

a.style.left ="0px";

a.style.backgroundColor =vtabcolor;

tagulli.style.borderTop = vborder;

}

}

}

function bindEvent(container, e) {

var tp = gettab(container).position;

var ele = $$(getUL(container,tp),'li');

for(var i=0; i<ele.length; i++){

if (e=="click") {

ele.onmouseover ="";

ele.onclick = tabEvent;

}

if (e=="mouseover") {

ele.onmouseover = tabEvent;

}

}

}

function Bindtabs(id,activetab1,eventType,position,border,tabcolor,bkcolor,width) {

this.id = id;

this.activetab1 = activetab1;

this.eventType = eventType;

this.position = position;

this.border =border;

this.tabcolor=tabcolor;

this.bkcolor=bkcolor;

this.width = width;

this.c = function () {

showContent(this.id,this.activetab1);

bindEvent(this.id,this.eventType);

}

}

function getUL(id,ttp) {

if ((ttp=="t") || (ttp=="l") ||(ttp=="p")) {

var ul = $$($(id),('ul'))[0];

}

else

{

var n = $$($(id),('ul')).length;

var ul = $$($(id),('ul'))[n-1];

}

return ul;

}

function gettab(id) {

return (id=="tabco4") ? t4 : t1;

}

function ie6() {

var appVer = navigator.appVersion.toLowerCase();

var iePos = appVer.indexOf('msie');

if (iePos !=-1) {

is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))

is_major = parseInt(is_minor);

}

var is_ie = ((iePos!=-1));

var is_ie6 = (is_ie && is_major == 6);

return is_ie6;

}

function getmarginBottom(obj) {

return (obj.currentStyle) ? obj.currentStyle.marginBottom : getComputedStyle(obj,'').getPropertyValue('margin-bottom');

}

function getmarginRight(obj) {

return (obj.currentStyle) ? obj.currentStyle.marginRight : getComputedStyle(obj,'').getPropertyValue('margin-right');

}

function getbkColor(obj) {

return (obj.currentStyle) ? obj.currentStyle.backgroundColor : getComputedStyle(obj,'').getPropertyValue('background-color');

}

function getTargetElement(evt) {

return (evt.target) ? ((evt.target.nodeType == 3) ? evt.target.parentNode : evt.target) : evt.srcElement;

}

function $(id){ return(document.getElementById(id)); }

function $$(e,tag) {return e.getElementsByTagName(tag);}

ولی وقتی باشه، منوی دومی کار نمیکنه. ولی باید باشه چون اگه نباشه منوی اولی از کار میافته.

این هم اسکریپت منوی دومی:


<script>
$(document).ready(function() {
$(".tab").slideUp();
$(".tab:first").slideDown();
$("ul.tabs01 li").click(function() {
$("ul.tabs01 li").removeClass("active");
$(this).addClass("active");
$(".tab").slideUp();
var activeTab = $(this).attr("rel");
$("#"+activeTab).slideToggle();
});
});
</script>

تداخل بین همین دو اسکریپت هست.

ویرایش شده توسط Morteza
لینک به ارسال

شما افزونه فایر باگ فایرفکس نصب کنید و اجراش کنید و اخطارهایی که اون پایین زده اینجا مطرح کنید:

نمونه آموزش:

http://wpu.ir/btjyx

لینک به ارسال

ممنون

خب این خطاها رو نشون میده:


Failed to load resource: the server responded with a status of 404 (Not Found)
jd.gallery.cssFailed to load resource: the server responded with a status of 404 (Not Found)
mootools.v1.11.jsFailed to load resource: the server responded with a status of 404 (Not Found)
jd.gallery.js.phpFailed to load resource: the server responded with a status of 404 (Not Found)
jd.gallery.transitions.jsFailed to load resource: the server responded with a status of 404 (Not Found)
jRating.jquery.js:10Uncaught TypeError: Cannot call method 'split' of undefined
tabmenu.js:217Uncaught TypeError: Object [object Object] has no method 'getElementsByTagName'

$$tabmenu.js:217
showContenttabmenu.js:57
Bindtabs.ctabmenu.js:159
inittabmenu.js:15
window.onload

که ارور آخری که مربوط به tabmenu.js است فکر کنم مشکل داره

فایل tabmenu رو پیوست کردم.

1.rar

لینک به ارسال

خوب اول اینکه 5 تای اول 404 داده یعنی فایلهاش لود نمیشه و حذف شده

ششمی هم احتمالا بخاطر استفاده از یکی از بخشهای بالایی ش مشکل عدم شناخت داده

خط بعدی مشکل کدنویسی و استفاده از متد هست

لینک به ارسال

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

×
×
  • اضافه کردن...