$(document).ready(function() {On another note, the GUI for HC Plus is coming along slowly. Bit of a learning curve understanding some of these new methods and callback functions. Help from other coders is helping me to learn a lot.
var div = $("
");
var image = $('.postbody img');
image.appendTo(div);
image.detach();
image.hide();
var button = document.createElement("input");
button.setAttribute("type","button");
button.setAttribute("value","Image");
button.setAttribute("class","button2 btnlite");
$(button).click(function (){
$(image).toggle();
});
div.appendTo($('.postbody'));
button.appendTo($(this));
});
I also managed to tweak the image resizer for HC Plus. new code:
// Image Resize
function imageResize(){
$('.postbody img')
for (i=0; i<$(this).length; i++) {
if ($(this).style.maxWidth >= '400' + 'px' || $(this).style == undefined) {
$('cssText').css($(this), "{ max-width: 500px; height: auto;}");
$(this)[i].addEventListener('click', function(event) {
if (event.currentTarget.style.Maxwidth == 'none')
event.currentTarget.style.maxWidth = '400' + 'px';
else
event.currentTarget.style.maxWidth = 'none'; }, false);
}
}
}
I'm so out of practice it's pathetic.
No comments:
Post a Comment