开发者

jQuery Lightbox Clone is not initialising properly

开发者 https://www.devze.com 2023-01-01 16:52 出处:网络
Help...? Hey, I have the following function on an onClick call: function addComment() { jQuery.noConflict();

Help...?

Hey, I have the following function on an onClick call:

   function addComment() {
        jQuery.noConflict();
        jQuery('head').append('<link rel="stylesheet" media="screen" type="text/css" href="colorbox/colorbox-images.css" />'); //this doesn't add correc开发者_如何转开发tly.
        jQuery.fn.colorbox({inline:false, href:'boxes/add-comment.html'}); //or it could be this line not importing the page
        return false;
    };

However, the STYLESHEET append line doesn't seem to initialise properly. (NOTE: it may be that the content from "boxes/add-comment.html" aren't being added) - Screenshots below:


have you tried,

var link = $('<link>');
link.attr({
   'rel':'stylesheet',
   'media':'screen',
   'type':'text/css',
   'href':'colorbox/colorbox-images.css'
});
jQuery('head').append(link);


Turns out that it was a Float problem in the CSS, something didn't want to play ball.

0

精彩评论

暂无评论...
验证码 换一张
取 消