Jump to content

df_glazer

Members
  • Content Count

    9
  • Joined

  • Last visited

Everything posted by df_glazer

  1. Thanks for taking a look at this, I hope to test this tonight. I will let you know how I make out.
  2. This a JavaScript question regarding cross frame scripting: How do I target a div, in this case <div id=‘PF_Text_Panel’>’, in an iframe using and onclick event in the parent document. I have a document, the parent page, containing 1 iframe. The parent page also contains some general information and the navigation links. The links refer to unique .html files, child pages, which are slideshows of jpeg images of different architecture projects of mine. Clicking on a project navigation links loads a slideshow in the iframe. Within the child page, the slideshow is its own <div>. The child page also contains a text panel describing the project. The text is in <div id=‘PF_Text_Panel’>. The text panel can be slid out of the way. Sliding is controlled by an onclick event which fires a javascript Spry slide effect that has the <div id=‘PF_Text_Panel’> as its target. The function which contains the slide effect is Slide_1T(). This function works fine when the event handler is in the same frame as <div id=‘PF_Text_Panel’>. http://dg-ad.com is set up that way now but I would like to change it. The following is a snippet of how I would image the parent page onclick event handler to look like but with some additional code in the Slide_1T() portion: <div><a href="#" onclick="setSldPnlState_2(); Slide_1T('PF_Text_Panel');">(TOGGLE TEXT PANEL)</a></div>
  3. Thanks for the suggestions, I will start where you suggested
  4. Okay, so I figured out how to pass a variable via a query string to force a child .html file to open in an iframe on a parent page (I posted a question here regarding this a couple of days ago). If the child file is specified in a URL like, www.dg-ad.com/PF-Skinner.html, some script in the child file, PF-Skinner.html, rewrites the URL like this, http://dg-ad.com/index.html?var1=http://dg-ad.com/PF-Skinner.html. Some script in the parent file parses the query string and forces the child file to open in an iframe name=pf_frame on the page. There is a function in this parent script called refreshFrame. It is set to run as an onload event in the body tag, if there it sees the rewritten URL it loads the child just fine. If there is just a basic URL the page works fine, the iframe is empty. Also, I am using SpryURLUtils.js to get a Spry accordion to open the a specific panel using a query string. It works, but only okay, the results are unexpected. The accordion panel contains links that load child .html fragments into an iframe. When I pass the variable panel in query string like this, www.dg-ad.com?panel=1 the panel opens but the iframe displays a page not found error message. Why would just opening the accordion try to open the iframe. If I open the accordion by clicking links on the page this doesn’t happen. Also, strangely, if I specify the panel=0 the first panel does not open, only the values 1,2 and 3 work (there are no values beyond that). Could the function in the onload event called refreshFrame be parsing the variable panel=1, loading it as a fragment in the iframe and then not finding it. In other words could using the function refreshFrame prevent using additional parameters in the query string. Thanks for looking and for any thoughts The code for both the parent and child are attached.index.htmlPF-Skinner.html
  5. I am looking for some hints regarding sending people links to my website, http://dg-ad.com A user clicks a project link from a list of projects, below is an example of a project link: <a href="PF-Skinner.html" onclick="updatePortfolioFrame(this); return false;">SCHOOL OF NURSING UMASS AMHERST</a> Using javascript's innerHTML and which/this functions, an iframe is placed in a div. The src for the iframe is the href from the anchor tag. This href references a small html file that is a list of jpegs that are then displayed as a slide show in an iframe on the parent page. This is the script: <script type="text/javascript">function updatePortfolioFrame(which){document.getElementById('portfolio').innerHTML = '<'+'iframe id="pf_window" name="pf_window" type="text/html" frameborder="no" scrolling="no" src="'+which.href+'"><\/iframe>';}</script> Now if you surf to the site, the parent page does not display any slideshow, the user navigates to projects using menus. This is the question: I want to be able to send people links to the parent page with the slideshow of a specific project open in the iframe. My javascript function updatePortfolioFrame specifies the src of the iframe as a variable. I suspect that I can pass the variable in the URL/link to the function. If this is the right concept could anyone suggest some direction for me to follow, some code, some keywords to google, or some web sites that may illustrate some methods. Thanks for thinking about this. Daniel
  6. Ironically, the reason I have been engrossed in this project is because I wanted to get away from iframes. I can pretty easily reinstitute them and I did a ton of other improvements. It just seems like such an irritating thing to have a tag that just doesn't work in a product, IE, that was designed by the same company that introduced the object tag in the first place. Thanks for taking a look, I was afraid reverting to iframes may be the simplest recourse. Have a good week.
  7. Is it my imagination or does IE 8 really have a trouble executing the <object> tag. I have some javascript that loads an html fragment into an <object> tag the is wrapped in a div. The html fragment references a .xml file which puts a slideshow of a series of jpegs in the parent file. Works great in Firefox. Thought it would be an easy tweak to some settings to make it work in IE8. No luck. IE adds scrollbars and a grey border, worst of all it won’t load the content. Maybe there is a tweak I haven’t heard about…yet. Any advice would be GREATLY appreciated. These are the relevent code snippets, or see it in action at dg-ad.com: this snippet from the head: <!--define links to open in as <obj> in a <div> using .js--><script type="text/javascript">function updatePortfolioFrame(which){document.getElementById('portfolio').innerHTML = '<'+'object id="pf_window" name="pf_window" type="text/html" data="'+which.href+'"><\/object>';} this one allows you to click on the words School of Nursing...: <a href="PF-Skinner.html" onclick="updatePortfolioFrame(this); panelWidget.loadContent('PF-Skinner-TXT.html'); setSldPnlState_1(1); Slide_1('PF_Text_Panel'); return false;">SCHOOL OF NURSING<br />SKINNER HALL<br />UMASS AMHERST</a><br /> which loads PF-Skinner.html into the object tag, the class portfolio defines a width and height, some float: <div id="portfolio"> <object type="text/html" name="pf_window" class="portfolio" id="pf_window"></object></div><!--End portfolio_window for slidewhows--></div>
  8. I have a page with a div, <div id= PF_Text_Panel></>, containing text that describes an image, the image is in a separate div. Using CSS the text panel is on top of the image and covers about 1/3 of the image’s left side. A slide effect, handled by the function Slide (see code below), targets the PF_Text_Panel div. The function Slide is triggered by an onClick event allowing the user to slide the description to the left and reveal the entire image. I am trying to write some code that will, in a sense, disable the slide effect with an onclick event. Until I turn it back on with another onclick event. The function Slide contains an if statement. The if statement is used to determine if PF_Text_Panel is open or closed using the variable SldPnlState as a flag. If the variable SldPnlState ==1, then run Slide. The other part of this function, which actually slides the div is an instance of the Slide Effect, inserted using Dreamweaver CS4. The variable SldPnlState is set using the function setSldPnlState The function setSldPnlState, initiated by an onClick, passes a value to the variable SldPnlState, in this case it can be set to either 0 or 1 by separate onClick events. It seems like the function Slide always refers to the default value of the variable and not value I am trying to pass. If set to 1 sliding occurs and if I set it to zero no sliding, but at least I know the slide function is working. So… …to test if the variable SldPnlState is being passed from the onClick event to the variable I included the function printVar which writes the value of the variable SldPnlState to the screen which seems to work fine, You can demo the page at: http://dg-ad.com/Sli..._Parameter.html Could there be a problem with how I am declaring the variable SldPnlState or thr function setSldPnlState, perhaps there is some conflict between local and global variable. Attached is the code, if anyone has some suggestions I would sure appreciate hearing from you: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Develop Slide Panel Logic Parameter" content="text/html; charset=utf-8" /><title>Develop Slide Panel Logic Parameter</title><link href="G-Ad Main Style.css" rel="stylesheet" type="text/css" /><!--begin setup Spry Effects--><script src="SpryAssets/SpryEffects.js" type="text/javascript"></script><script language="javascript" type="text/javascript"><!--Begin pass variable from flagToggle parameter to SldPnlState variable includes printVar function to sent results to screen--><!--begin set flag using onclick event-->var SldPnlState = 1;function setSldPnlState(flagToggle){SldPnlState = flagToggle;}</script><!--end set flag using onclick event--><!--begin slide function onclick event--><script type="text/javascript">if(SldPnlState==1)function MM_effectSlide(targetElement, duration, from, to, toggle, transition, fps, horizontal){Spry.Effect.DoSlide(targetElement, {duration: 500, from: 0, to: 200, toggle: true, transition: 2, fps: 750, horizontal: true});}//--></script><!--begin slide function onclick even--><!--begin write variable to screen onclick event--><script type="text/javascript">function printVar(){document.getElementById('test_display').innerHTML = SldPnlState}</script><!--begin write variable to screen onclick event--></head><body id="wrapper"> <div style="padding-top:50px;"> <a href="#" onclick="setSldPnlState(1);">Set var SldPnlState to Flag Status Set Open (1)</a><br><br><br> <a href="#" onclick="setSldPnlState(0);">Set var SldPnlState to Flag Status Set Closed (0)</a><br><br><br> <a href="#" onclick="printVar();">Print Flag Status to Screen</a><br><br><br> <div id="test_display" style="border:#9CC thick groove; width:50px; height:50px; margin:15px; text-align:center; font-size:36px;"></div> <a href="#" onclick="MM_effectSlide('PF_Text_Panel');">Slide Panel</a><br><br> </div><div id="PF_Text_Panel" style="border:#9C9 thick solid; height:250px; margin-top:25px;"> <div id="PF_Text" class="PF_Text"> </div></div></body></html>
×
×
  • Create New...