Tuesday, January 10, 2012

How to Open popup in chrome without scrollbars, Disable Resize of popup and Auto resize according to content

Today I am going to show a tutorials which is a deadly need for many webmasters these days.

Chrome is the most popular browser used by many users these days. Popup is a thing which is used by from Facebook to simple advertisers. Sometimes situations may arise when we want features in opened popup windows.

We Usually ask some Questions related to Popups specially for Chrome:

  • How to disable scroll-bars in chrome popup ?
  • How to prevent Re-size of popup window opened ?
  • How to Auto Re-size Popup window according to the content inside it ?

Is it possible to answer above Questions ?

Now its a YES.

Here we go ....

All changes or Additions will be done in the page which will open inside the Popup Window.

Step 1)

and download a .js file naming controll_popup.js and upload it on your server or any free file hosting site you can file any by simple goggling.

use below code to add this file in page opening in Popup window


<script type="text/javascript" src="http://yourserver.com/controll_popup.js"></script>
change Red text with your server name where you uploaded file

Step 2) 

Now add this simple script in Head of your page



<script type="text/javascript">
Bootloader.setResourceMap({"3qyfR":{"type":"js","src":"https:\/\/s-static.ak.facebook.com\/rsrc.php\/v1\/yD\/r\/BolR11s_Va_.js"}});
Arbiter.registerCallback(InitialJSLoader.callback, ["BOOTLOAD\/ROADRUNNER_READY"]);
Arbiter.registerCallback(function() {InitialJSLoader.load(["3qyfR"]);Arbiter.inform("BOOTLOAD\/ROADRUNNER_READY", true, Arbiter.BEHAVIOR_STATE);}, [OnloadEvent.ONLOAD_DOMCONTENT_CALLBACK]);
onloadRegister(function (){PopupResizer.init( { allowShrink : false });});
</script>


Now your page which will open in Popup window will have a code like this given below 


<HTML>
<HEAD>
<script type="text/javascript" src=" http://yourserver.com/controll_popup.js "></script>
<script type="text/javascript">
Bootloader.setResourceMap({"3qyfR":{"type":"js","src":"https:\/\/s-static.ak.facebook.com\/rsrc.php\/v1\/yD\/r\/BolR11s_Va_.js"}});
Arbiter.registerCallback(InitialJSLoader.callback, ["BOOTLOAD\/ROADRUNNER_READY"]);
Arbiter.registerCallback(function() {InitialJSLoader.load(["3qyfR"]);Arbiter.inform("BOOTLOAD\/ROADRUNNER_READY", true, Arbiter.BEHAVIOR_STATE);}, [OnloadEvent.ONLOAD_DOMCONTENT_CALLBACK]);
onloadRegister(function (){PopupResizer.init( { allowShrink : false });});
</script>
</HEAD>
<BODY>
<<  TO SHOW WILL BE DISPLAYED OVER HERE >>
</BODY>
</HTML>
After applying all above changes I challenge you will not be able to hide any content from popup window  :)

the script given for download is a part of Facebook

0 comments:

Post a Comment

Feel free to leave comment if you like above widget, have any questions or just say Hi! :)