Trying to close a pop-up plugin on a 'onviewchange' event

  • I'm sure I'm just not quite coding the magic words but: I'm trying to get a pop-up plugin to close when there's a 'onviewchange' event.

    My plugin is simply a .png that has a name=testwindow1 and a visible that's set to"true" when a hotspot is clicked.

    To make the visible = "false" I try this:

    Code
    <events  onviewchange= "checkH();" />


    then:

    Code
    <action name="checkH"> 	if ( (plugin[testwindow1].visible,true), set(plugin[testwindow1].visible,false) );   </action>


    But the plugin doesn't respond. I've also tried putting the set(plugin[testwindow1].visible,false) inside a seperate action which I call from the if statement, but that's a no-go as well.

    Any ideas out there? Thanks in advance, Craig.

  • Thanks for your help with syntax but your code still doesn't affect my plugin.

    I'm confused by this, because I have a functioning piece of code, inside an action connected to the 'onclick' event in the plugin, that lets me "close" the plugin when click anywhere directly on the plugin. But when I put the same code, or action-call, inside another action I get nothing!

    So, to be clear, when I do this:

    Code
    <plugin name="testwindow1" url="testpopup.png"  visible="true"  enabled="true" " alpha="1.0"  onclick="Simonshutsup()" />


    and this:

    Code
    <action name="Simonshutsup">  set(plugin[testwindow1].visible,false); </action>


    it works.

    But when I do this:
    <events onviewchange= "checkH();" />
    and this:

    Code
    <action name="checkH">  if ( plugin[testwindow1].visible, set(plugin[testwindow1].visible,false) ); </action>


    it doesn't work!

    As they say in the Bronx, "What's up with that?"

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!