View Full Version : Ajax Side Panel script: Change width of the panel from the same link that calls it?

11-02-2014, 11:42 PM
1) Script Title: Script: Ajax Side Panel script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxsidepanel.htm

3) Describe problem:

Hi mate, greetings.

You can change the width of the panel from the same link that calls it ?. Something that can be added within the same code, to open in a different width:

<a href="http://www.mysite.com/index.html" rel="ajaxpanel" data-loadtype="iframe">My Home Page</a>

Or is there a way to do it?

Thank you!

11-03-2014, 05:26 PM
Try adding a function like the below to your page, which dynamically changes the width of the panel:


function changepanelwidth(w){
ddajaxsidepanel.$panelref.css('width', w)


Then inside one of your links to invoke the panel, augment it with the code in red to say, change the panel to 500px width when it's revealed:

<a href="http://www.cssdrive.com" rel="ajaxpanel" onClick="changepanelwidth(500)">CSS Drive</a>

11-06-2014, 08:43 PM

Thank you! Works for me.