Jquery Window.resizeto In Slow Motion
I want to resize a window in slow motion mode but the following code doesn't work and I have no idea what to do: var myWindow; function resize() { var windowsHeight = jQuery(wi
Solution 1:
In this example you can see the animation effect. Just customize it as you wish.
The trick is to use a custom animation with jquery.animate
.
functionpop(){
var win = window.open("", "Title", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=780, height=200, top=0, left=0");
win.document.body.innerHTML = "HTML";
$({foo:0}).animate({foo:100}, {
step: function(val) {
win.resizeTo(val * 5, val * 5);
}
});
}
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><buttononclick="pop()">Open</button>
Note: You can see the effect within the snippet for a security reason. You can see the effect in the fiddle(jsbin) I created:
Note 2: I checked this code in Google Chrome
and Mozila Firefox
The latest versions.
Post a Comment for "Jquery Window.resizeto In Slow Motion"