... external page load with jQuery... + then run a function
... I have this simple piece of jQuery code that loads in an external page:
$(document).ready(function(){
$('#info a').click(function(){
var href = $(this).attr('href');
$('#info_show').load(href).fadeToggle();
return false;
});
});
After loading the page I wanted to run a function that centers this
content into the window...
$(document).ready(function(){
$('#info').click(function(){
var href = $(this).attr('href');
$('#info_show').load(href).fadeToggle();
return false;
function move_div(){
window_width = $(window).width();
window_height = $(window).height();
obj_width = $('#holder').width();
obj_height = $('#holder').height();
$('#holder').css('top', (window_height / 2) - (obj_height /
2)).css('left', (window_width / 2) - (obj_width / 2));
}
$(window).resize(function(){
move_div();
});
});
});
... the 'move_div' does not run... can anyone help solve this... ?
T
No comments:
Post a Comment