Welcome to TalkGraphics.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2010
    Posts
    7

    Default modifying/extending onclick actions for photo popup objects

    Would like to have some javascript called when a photo thumbnail is selected in a photo popup/photo panel/photo object, can't seem to find a way to put that in. Didn't find any such discussions in the forum...
    For instance: the butterfly photo popup template, if someone clicked on the owl, i would have a button on the page where the text changed to owl.
    Any suggestions, or must i use php to hack this into the page after it's published?
    Footnote: sure would be nice if the photo popups had an option to be mousover or onclick activated, as well as being able to disable the mouseout - having the picture change on mouseout is mostly annoying...

  2. #2
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,486

    Default Re: modifying/extending onclick actions for photo popup objects

    Welcome to TalkGraphics

    You can have mouse over layers on a pop-up layer. You can have a Flash SWF file play on a pop-up layer (but it does not work in Opera).

    Have a look at Creating a Popup with a Link
    Creating Pop-ups and Creating a Drop Down Menu (this guest tutorial was created before the new Navigation Bar Tool).

  3. #3
    Join Date
    Jun 2010
    Posts
    7

    Default Re: modifying/extending onclick actions for photo popup objects

    Thanks for the reply. Well, those are interesting, and it might be easier to do that than figure out how to change the text in the photo popup panel objects, but they don't address a couple of my issues. (btw, the 3rd link, to guest8, is dead)

    1. i don't want mouseovers, i want clicks to change the photo. Having the photo change when the mouse is no longer over the thumbnail will not work for this website. When they click on a thumnail, i need the big picture to stay until they click on another thumbnail.

    2. where do i put the javascript i need to run, when the thumbnail is clicked? That won't prevent the existing onclick (updating the large picture from the thumbnail) from working?

    In the past, i've used webstyle to create the graphical part of the site, then gone in and coded the functions. This makes for a site that is difficult to maintain. I was hoping that with wd6's ability to include html, i could keep everything together...

  4. #4
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,044

    Default Re: modifying/extending onclick actions for photo popup objects

    Are you looking for this effect ?
    Attached Files Attached Files

  5. #5

    Default Re: modifying/extending onclick actions for photo popup objects

    I think I understand what you are asking - if I do, then this (or something similar) can all be done in Web Designer 6 (which I see from your profile you are using) without any post-export HTML hacking.

    Please see this DEMO

  6. #6
    Join Date
    Jun 2010
    Posts
    7

    Default Re: modifying/extending onclick actions for photo popup objects

    Drywd: thanks, i believe that is very similar to the Beta photo popup in WD6, but looking it over helped me figure out how to change the text that shows up for the different pictures, when they are clicked. If i could execute some code on the clicks, this would be great.

    sledger: well, that's cool. took a while for me to grok. Is the thought that javascript code could be fired off when the iframe is changed? I'm not sure if there is an event for that - don't think onfocus would fly, as it is the thumbnail that is getting clicked, not the iframe...

    Sorry if i'm overlooking something obvious, i'm accustomed to using code to do things, not layers. But lets say the text i have to show under the large photo (using either of these solutions) has to come from a database, which means i have to call a function when the selection is made - when the thumbnail onclick() is called. That's what i'm trying to figure out, is where to put that code. If there was a way in the web properties tab to put another function name, that would be called after the one that updates the large picture, well that would be fabulous! I think...

  7. #7

    Default Re: modifying/extending onclick actions for photo popup objects

    I'm not fully understanding what you want, clearly.
    Maybe you can point me to an example?
    But please understand that Xara Web Designer (or Xtreme 5 / Designer Pro 6) are not a HTML editors in any way - what you seem to require isn't what Xara created Web Designer for at all. Sure, we can get tricky with placeholders, but that's down to our own inginuity.
    Pure HTML help isn't appropriate for WYSIWYG software and editing the exported HTML is not recommended at all for good reason.

  8. #8
    Join Date
    Jun 2010
    Posts
    7

    Default Re: modifying/extending onclick actions for photo popup objects

    Sorry, i'm doing this website under a NDA so i can't provide examples, but the prior scenario involving database access is a generic example of what i need - to run some arbitrary javascript when an object is clicked. Ideally, i would like to add it to the existing functionality of the gallery.xar, or the Beta photo popup, or the Butterfly photo panel in the WD6 "photo objects".
    In WD6, the different photos that occupy the same space are in layers - in the real world of browsers, "we ain't got no stinkin' layers" and the effects are done by using mouseover events to make different divs visible (as near as i can tell, haven't had time to really examine the code), so the webpage uses javascript to produce the same results as changing layers.

    What i need is to perform _another_ javascript function in addition to the one(s) that swap the pictures and text around. This wouldn't seem to be any more difficult than adding another option in the web properties window (says the guy who doesn't have his fingers in the codebase) for additional functions to be called on the activation event (mouseover, onclick, mousemove, whichever). This would greatly extend the ability of xara websites for those of us who are crazy enough to write code...

    I've read the philosphy statements about how xara is for graphics artists, and not for programmers. I use xara bc i'm NOT a graphics person - i can do ok work, but i would rather let WD6 take care of matching colors and setting gradients and rounding corners and all that stuff that looks nice but takes me enormous amounts of time, but there are many things that can be done SOOOO much more effectively and be more maintainable by using scripts.

    e.g. have a gallery or photo object, 3 thumbnails and 1 big picture. normal function is: click a thumbnail, big picture updates. But i want to change the entire web page background color (or send a text message using SMS to someone, or any number of other silly things that can be done in a script) when the middle thumbnail is selected * in addition to * the normal function of updating the big picture. If the options had a place for a script "hook", and a way to incorporate ones .js files (using "link to file"?), such abnormal behavior could be easily accomodated.

    Word processors (open office, M$word) don't *require* you to use macros, but that option exists if you need it. Probably less than 5% of users even know this is possible, but entire companies have been built creating "applications" using macro-driven programs. Having the ability to add code would be similar, would greatly expand the usefulness of the websites, and if you found a way to allow PHP to be incorporated, you might have to get a bigger order-processing server to handle the load. :->

  9. #9

    Default Re: modifying/extending onclick actions for photo popup objects

    Sorry, I really don't think WD6 is for you.

 

 

Tags for this Thread

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
  •