Hi,
ich will auf meiner Seite das jQuery Cycle Plugin mit einer Lightbox verwenden. Beide verwenden $ daher brauche ich noConflict. Ich habe daher folgende Methode angewand.
und meine $ in meinem jQuery-Code mit jQuery ersetzt. So sah am Anfang; auch gut aus Lightbox funktionierte jQuery funktionierte bis auf einige meiner Funktionen.
Hier mal das ganze Skript:
folgende Funktionen stellen ihren Dienst ein:
die Funktionen in der liste "navigation", pause_g sowie resume_g.
Hat jemand eine Idee woran das liegen kann oder noch besser wie ich das beheben kann??
ich will auf meiner Seite das jQuery Cycle Plugin mit einer Lightbox verwenden. Beide verwenden $ daher brauche ich noConflict. Ich habe daher folgende Methode angewand.
Code:
$.noConflict();
jQuery(document).ready(function($) {
Hier mal das ganze Skript:
Code:
$.noConflict();
jQuery(document).ready(function($) {
$(document).ready(function() {
$('#slideshow').cycle({
fx: 'fade',
speed: 1000,
timeout: 4000,
next: '.next',
prev: '.prev',
before: onBefore,
after: onAfter,
});
});
document.getElementById('g_play').style.display=none;
function setSlide(index) { $('#slideshow').cycle(index);}
function pause_g () { $('#slideshow').cycle('pause');}
function resume_g() { $('#slideshow').cycle('resume');}
function onBefore(curr, next, opts) { var img_name = "\"" + this.alt + "\""; $('#output').html(img_name); }
document.getElementById('download_b').innerHTML="<div style='height:18px; width:18px; background-image:url(img/menue/gallery_menue_save.png);'></div>"
document.getElementById('download_b').href= "\"" + img_id + "\""
document.getElementById('download_b').target="_blank"
document.getElementById('full_b').innerHTML="<div style='height:18px; width:18px; background-image:url(img/menue/gallery_menue_screen.png);'></div>"
document.getElementById('full_b').href=img_id_big
document.getElementById('full_b').rel="lightbox"
function onAfter(curr, next, opts) { var img_name = "\"" + this.alt + "\""; $('#output').html(img_name); var img_id = "\/img\/gallery\/b1_"+ opts.currSlide+".jpg";var img_id_big = "\/img\/gallery\/big\/b1_"+ opts.currSlide+".jpg"; var img_cur = opts.currSlide;
if (opts.currSlide !== 100) {javascript:document.getElementById('aktive_cycle').style.left= opts.currSlide*22+113 +"px"; }
if (opts.currSlide !== 100) {
document.getElementById('download_b').innerHTML="<div style='height:18px; width:18px; background-image:url(img/menue/gallery_menue_save.png);'></div>"
document.getElementById('download_b').href= img_id
document.getElementById('download_b').target="_blank"
document.getElementById('full_b').innerHTML="<div style='height:18px; width:18px; background-image:url(img/menue/gallery_menue_screen.png);'></div>"
document.getElementById('full_b').href=img_id_big
document.getElementById('full_b').target="_blank"
if (img_cur == 0){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2008<font class='grey'>, original resolution </font>2000px*1050px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/art/Real-Air-Force-96580728' target='_blank'>[link]</a>"}
if (img_cur == 1){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2010<font class='grey'>, original resolution </font>2000px*1125px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/#/d2pnzd1' target='_blank'>[link]</a>"}
if (img_cur == 2){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2010<font class='grey'>, original resolution </font>2300px*1036px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/#/d2ulrc3' target='_blank'>[link]</a>"}
if (img_cur == 3){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2010<font class='grey'>, original resolution </font>1920px*1080px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/#/d322ypo' target='_blank'>[link]</a>"}
if (img_cur == 4){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2010<font class='grey'>, original resolution </font>2880px*1620px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/#/d2m0lbm' target='_blank'>[link]</a>"}
if (img_cur == 5){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2010<font class='grey'>, original resolution </font>1291px*2010px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/#/d2m0kj4' target='_blank'>[link]</a>"}
if (img_cur == 6){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2008<font class='grey'>, original resolution </font>4400px*2112px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/?offset=24#/d1rpqst' target='_blank'>[link]</a>"}
if (img_cur == 7){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2008<font class='grey'>, original resolution </font>1600px*800px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/?offset=24#/d1qi2gz' target='_blank'>[link]</a>"}
if (img_cur == 8){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2009<font class='grey'>, original resolution </font>1920px*1440px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/?offset=24#/d2bg3id' target='_blank'>[link]</a>"}
if (img_cur == 9){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2009<font class='grey'>, original resolution </font>2000px*800px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/?offset=24#/d1xfmid' target='_blank'>[link]</a>"}
if (img_cur == 10){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2009<font class='grey'>, original resolution </font>2500px*1000px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/7766234#/d25yqcj' target='_blank'>[link]</a>"}
if (img_cur == 11){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2009<font class='grey'>, original resolution </font>1600px*2500px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/7766234#/d21g6rs' target='_blank'>[link]</a>"}
if (img_cur == 12){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2009<font class='grey'>, original resolution </font>3000px*1400px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/?offset=24#/d2a7rkp' target='_blank'>[link]</a>"}
if (img_cur == 13){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2008<font class='grey'>, original resolution </font>2000px*1050px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/?offset=24#/d1kkuic' target='_blank'>[link]</a>"}
if (img_cur == 14){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2009<font class='grey'>, original resolution </font>1600px*900px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/?offset=24#/d1yt2nz' target='_blank'>[link]</a>"}
if (img_cur == 15){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2010<font class='grey'>, original resolution </font>2000px*2000px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/?offset=0#/d2rm4t5' target='_blank'>[link]</a>"}
if (img_cur == 16){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2009<font class='grey'>, original resolution </font>2200px*1056px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/?offset=24#/d1trqma' target='_blank'>[link]</a>"}
if (img_cur == 17){document.getElementById('g_info_container').innerHTML= "<font class='grey'>by Martin Steil</font> 2009<font class='grey'>, original resolution </font>4000px*1600px<font class='grey'>, deviantart </font><a class='simple' href='http://sga-maddin.deviantart.com/gallery/?offset=24#/d2508iz' target='_blank'>[link]</a>"}
}
}
function container_pic_1() { javascript:document.getElementById('prev_container').style.display= "none"; }
function hover_dot_a (index) {
var current_dot = "n_" + index
var index18 = "javascript:setSlide(" +index+")"
var index_bg = index
document.getElementById(current_dot).style.backgroundPosition="0 22";
document.getElementById('prev_container').style.left= index*22+59 +"px";
document.getElementById('prev_container').style.display= "block";
document.getElementById('prev_link18').href= index18
}
function out_dot_a (index) {
var current_dot = "n_" + index
document.getElementById(current_dot).style.backgroundPosition="0 22px";
}
});
die Funktionen in der liste "navigation", pause_g sowie resume_g.
Hat jemand eine Idee woran das liegen kann oder noch besser wie ich das beheben kann??
Zuletzt bearbeitet: