Results 1 to 3 of 3

Thread: Switch Content Script - inside Expandable iframe

  1. #1
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Switch Content Script - inside Expandable iframe

    1) Script Title: Switch Content Script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tchcontent.htm

    3) Describe problem:
    I've using this script inside that a page, that is loaded inside expandadle iframe, is there a way to modify the script to make it call paren.resizeIframe when any text block is expanded.

    Thanks,
    Tareq

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'd go after these two functions (additions dark red):

    Code:
    //PRIVATE: Contracts a content based on its corresponding header entered
    
    switchcontent.prototype.contractcontent=function(header){
    	var innercontent=document.getElementById(header.id.replace("-title", "")) //Reference content for this header
    	innercontent.style.display="none"
    	this.togglestatus(header, this.statusClosed)
    	this.togglecolor(header, this.colorClosed)
            parent.resizeIframe();
    }
    
    
    //PRIVATE: Expands a content based on its corresponding header entered
    
    switchcontent.prototype.expandcontent=function(header){
    	var innercontent=document.getElementById(header.id.replace("-title", ""))
    	innercontent.style.display="block"
    	this.togglestatus(header, this.statusOpen)
    	this.togglecolor(header, this.colorOpen)
            parent.resizeIframe();
    }
    And possibly this one as well:

    Code:
    switchcontent.prototype.sweepToggle=function(setting){ //PUBLIC: Expand/ contract all contents method. (Values: "contract"|"expand")
    	if (typeof this.headers!="undefined" && this.headers.length>0){ //if there are switch contents defined on the page
    		for (var i=0; i<this.headers.length; i++){
    			if (setting=="expand")
    				this.expandcontent(this.headers[i]) //expand each content
    			else if (setting=="contract")
    				this.contractcontent(this.headers[i]) //contract each content
    		}
    	}
            parent.resizeIframe();
    }
    There might be others but, hopefully that will do it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking It's working more than fine !

    John,

    Thank you very much, you've just made my day !
    It's working perfect.

    Have a nice day.

    -Tareq

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •