Код: Выделить всё
content
/*bottom of body*/
$(document).ready(function() {
$(".example3").fancybox({
'transitionIn' : 'none',
'transitionOut' : 'none'
});
});
Код: Выделить всё
window.onload=function(){
var mycode;
mycode=document.createElement("script");
mycode.type="text/javascript";
mycode.src="jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack.js";
document.getElementsByTagName("head")[0].appendChild(mycode);
}
Как мне это сделать?
Полное решение, основанное на ответе Джамеда Доннелли:
Я удалил все скрипты .js из головы. Затем я добавил это прямо перед тегом:
Код: Выделить всё
(function() {
function getScript(url,success){
var script=document.createElement('script');
script.src=url;
var head=document.getElementsByTagName('head')[0],
done=false;
script.onload=script.onreadystatechange = function(){
if ( !done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete') ) {
done=true;
success();
script.onload = script.onreadystatechange = null;
head.removeChild(script);
}
};
head.appendChild(script);
}
getScript("jquery-1.8.3.min.js",function(){
getScript("jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack.js", function() {});
getScript("myCustomScript.js", function() {});
});
})();
Код: Выделить всё
$(document).ready(function(){
$(".example3").fancybox({
'transitionIn' : 'none',
'transitionOut' : 'none'
});
});
Подробнее здесь: https://stackoverflow.com/questions/166 ... javascript
Мобильная версия