Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: Minimize Frame

  1. #1
    New Coder
    Join Date
    Jul 2002
    Location
    Tejas
    Posts
    38
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Minimize Frame

    Gettyimages.com uses a Java Script to minimize a frame on their website. There is text that says, "minimze frame window." After selecting it, the frame is reduced and the text changes to, "maximize frame view."

    I would like to use this Java Script on my site, but I can't find this script. Any tips?

    isak.

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Location
    U.S. (Wish Japan though)
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can't really help you right now, but could you post the actual url of the page that uses the script. I tried the page you told posted earlier, but I could not find the minimize script.. sorry

  • #3
    New Coder
    Join Date
    Jul 2002
    Location
    Tejas
    Posts
    38
    Thanks
    2
    Thanked 0 Times in 0 Posts
    If you go to http://gettyimages.com/, then click on creative, search for say a "horse," then add one of the images to a lightbox, the lighbox appears at the bottom of the page in its own frame. As a matter of fact, you can view your account or view your lightbox within this frame.
    Hope that helps.

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    U.S. (Wish Japan though)
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Unfortunatly, I can't get to the page without signing up, so this is what I am gonna ask you to do. Do what you do to get to the resize message. Right click on the page and then click on view scr when the menu pops up. Save the page source code and put it in a zip fil, and I will isolate the script for you if it is a Java Script.

    Will that work?

  • #5
    New Coder
    Join Date
    Jul 2002
    Location
    Tejas
    Posts
    38
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Let me know if you have a problem with the file... it's a mac zip.
    Attached Files Attached Files

  • #6
    Regular Coder
    Join Date
    Jul 2002
    Location
    U.S. (Wish Japan though)
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, I did have 1 problem with the file.... instead of going ot hte next line where it was supposed to.. the file src was actually black squares... lol After about 20-30 minutes of cleaning up the src.... I found how they did the minimize and maximize... All I have to say is I am not sure if they are using external scripts or if I just plain cannot read it.... I am going ot pist the code here and maybe someone else can m,ake sense of all this stuff... I am gonna cut the file down to what I think are the only lines necessary... it is too long fora normal post

    Code:
    <html>
    <head>
    <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
    <!-- GETTYONE.COM MAC NS6 STYLE SHEET -->
    
    <script src="/source/include/DOM_utils.js" type="text/javascript"></script><script type="text/javascript"> //--- Define common is_rollover 
    <title>Lightbox View -&nbsp;G1WEB11</title>
    <script type="text/JavaScript">
    <!-- Hide the script from old browsers --				
    var g_createLightboxPopup = null;
    function frameLoad()
    {
    	var strParam = "hdnSync=";
    	if (parent.location.href.lastIndexOf("?") != -1) {
    		strParam = "&" + strParam;
    	} else {
    		strParam = "?" + strParam;
    	}
    	parent.location.href = parent.location.href + strParam;
    }
    function link(form) 
    {        
    	var s = location.href;
    	var i = s.lastIndexOf("?");
    	if (i != -1) s = s.substring(0, i)
    	var myindex=form.selList.selectedIndex;
    	if (form.selList.options[myindex].value != "0")
    		location.href = s + form.selList.options[myindex].value;
    }
    function minimizeView(minimize)
    {
    	if( g_createLightboxPopup != null )
    		g_createLightboxPopup.close();
    	manageView(minimize, -1);
    }
    function maximizeView(orderView)
    {
    	manageView(0, orderView);
    }	
    function manageView(minimize, orderView)
    {
    	var hrefMain = parent.location.href;
    	var i = hrefMain.indexOf("?");
    	if (i != -1)
    		hrefMain = hrefMain.substr(0, i);
    	var qs;
    	var elTopFrame = GetFrame("top");
    	if (elTopFrame == null)
    		return;
    	var hrefTopFrame = elTopFrame.document.location.href;
    	var i = hrefTopFrame.indexOf("?");
    	if (i != -1)
    		qs = hrefTopFrame.substr(i);
    	else
    		qs = "";
    	qs = qs.replace(/&*minimizeView=\w/, "");
    	qs = qs.replace(/&*orderView=\w/, "");
    	qs = qs.replace(/&*lightboxView=\w/, "");
    	qs = qs.replace(/&*detailView=\w/, "");
    	qs = qs.replace(/\?\&/, "?")
    	i = qs.lastIndexOf("?");
    	if ((i != -1) && (i != qs.length - 1))
    		qs += "&";
    	else
    		qs = "?";
    	qs += "minimizeView=" + minimize;
    	if (orderView == 0)
    		qs += "&lightboxView=1";
    	else if (orderView == 1)
    		qs += "&orderView=1";
    	if (hrefTopFrame.lastIndexOf("/detail.asp") != -1) {
    		qs += "&detailView=1";
    		hrefMain = hrefMain.replace(/\/source\/\w*\/\w*\.asp/, "/source/search/resultsmain.asp");
    	}
    	else if (hrefTopFrame.lastIndexOf("/cdresults.asp") != -1)
    		hrefMain = hrefMain.replace(/\/source\/\w*\/\w*\.asp/, "/source/products/cdresultsmain.asp");
    	else if (hrefTopFrame.lastIndexOf("/cdimages.asp") != -1)
    		hrefMain = hrefMain.replace(/\/source\/\w*\/\w*\.asp/, "/source/products/cdimagesmain.asp");
    	else if (hrefTopFrame.lastIndexOf("/cdenlarge.asp") != -1)
    		hrefMain = hrefMain.replace(/\/source\/\w*\/\w*\.asp/, "/source/products/cdenlargemain.asp");
    	else if (hrefTopFrame.lastIndexOf("/catalog.asp") != -1)
    		hrefMain = hrefMain.replace(/\/source\/\w*\/\w*\.asp/, "/source/products/catalogmain.asp");
    	else if (hrefTopFrame.lastIndexOf("/catalogdetail.asp") != -1)
    		hrefMain = hrefMain.replace(/\/source\/\w*\/\w*\.asp/, "/source/products/catalogdetailmain.asp");
    	else if (hrefTopFrame.lastIndexOf("search/results.asp") != -1)
    		hrefMain = hrefMain.replace(/\/source\/\w*\/\w*\.asp/, "/source/search/resultsmain.asp");
    	parent.location.href = hrefMain + qs;
    }	
    function StatusOff()
    { 
    	return onText(""); 
    }
     
    function onText(str)
    { 
    	window.status = str; 
    	return true; 
    }
    //-->
    </script>
    </head>
    <body style="background-color:#DEDEDE;" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" onunload="Javascript:CloseLightboxPopup();">
    
    <a href=JavaScript:minimizeView(1); onmouseover="return onText('Minimize frame view')" onmouseout="return StatusOff()">
    Minimize frame view
    </a>
    I hope someone else can figure this out.... It stumped me.. I was hoping for a nice easy script to get out....

  • #7
    New Coder
    Join Date
    Jul 2002
    Location
    Tejas
    Posts
    38
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Looking at it yesterday, I thought they were combining 4 scripts (at least) into one to avoid scripting problems. I will try what you have and let you know how it goes for me. Thanks for your time.

    isak


  •  

    Posting Permissions

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