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.
精彩评论