Thursday, 8 August 2013

Make multiple iframe resizable in webpage

Make multiple iframe resizable in webpage

How to make multiple iframe resizable? i am able to make one iframe
resizable using jqueryUI library.
i have try as follow :
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Resizable - Default functionality</title>
<link rel="stylesheet"
href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"
/>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<style>
#iframe {
width: 100%;
height: 100%;
border: none;
background: #eee ;
}
#resizable {
width: 100px;
height: 100%;
background: #fff;
border: 1px solid #ccc;
}
</style>
<script>
$(function() {
$('#resizable').resizable({
start: function(event, ui) {
$('iframe').css('pointer-events','none');
},
stop: function(event, ui) {
$('iframe').css('pointer-events','auto');
}
});
});
</script>
</head>
<body>
<div id="resizable">
<iframe src="test.html" id="iframe">
</div>
</body>
</html>
above code work fine for me. but idont know how can i make multiple iframe
resizable. i have two iframe as in below image. i want make both of them
to resizable.
JSFiddle
Thanks in advance.

No comments:

Post a Comment