Loading ...
Sorry, an error occurred while loading the content.

RE: [ydn-javascript] Creating multiple instances of a PhotoBox panel

Expand Messages
  • Steven Peterson
    Trevor, You can modify this example by just instantiating multiple instances of PhotoBox on the same page, each with a different variable name, and setting the
    Message 1 of 2 , May 30, 2006
    • 0 Attachment

      Trevor,

       

      You can modify this example by just instantiating multiple instances of PhotoBox on the same page, each with a different variable name, and setting the “photos” property differently for each.  If you wanted to reuse the same PhotoBox Panel, you could do so by calling myPanel.cfg.setProperty(“photos”, your params) dynamically at runtime (calling a function that sets this argument on the click of each given button, I would imagine). Keep in mind that the PhotoBox example is very basic, and intended to show how Panel can be extended to do more complicated things. You might even decide to make it more feature-rich by enhancing it to use the Connection utility to dynamically retrieve the photos using the flickr API.  I look forward to seeing whatever you come up with!

       

      Thanks!

       

      Steven Peterson

      Web Developer, Platform Engineering

      Yahoo!

      From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Trevor L. Masinelli
      Sent: Sunday, May 28, 2006 5:52 PM
      To: ydn-javascript@yahoogroups.com
      Subject: [ydn-javascript] Creating multiple instances of a PhotoBox panel

       

      Does someone have an example (or can give a noob some guidance) for creating multiple
      PhotoBox panels on a single Web page?

      I don't want multiple iterations visible at the same time... I just want to be able to have 3+
      buttons on a Web page, each which opens the PhotoBox panel, but populated with
      different sets of images in it.  (see "panel-photo.html" in the YUI files for the single-button
      example.)

      Do I need to create some sort of if/when statements within the main code?  Or should this
      be handled at the button's "onClick" level, with some sort of addendum that tells the
      "photos:" callout what it should be populated with for that particular button?

      Anyone that can offer assistance, I'd really appreciate it.

      (Yahoo! team: would it be possible in the next update to add multi-button examples like
      this for people? I'd imagine a lot of people would like to see how to have multiple
      instances of a particular tool on a page, while being able to utilize the existing code in the
      most efficient manner.)

      Thanks in advance,

      T





      SPONSORED LINKS

      C programming language

      Computer programming languages

      Java programming language

      The c programming language

      C programming language

      Concept of programming language

       


      YAHOO! GROUPS LINKS

       

       


    Your message has been successfully submitted and would be delivered to recipients shortly.