PDA

View Full Version : Omni Slide & onclick events ?



kwinsor
05-07-2007, 06:53 PM
http://www.dynamicdrive.com/dynamicindex1/omnislide/index.htm

[question] Is it possible when clicking on the link within the menu to have an onClick event happen?

This is one of the links
["Finalize", "#application.root#expenses/approveExpenses.cfm?reason=approveExpenses&financeProcess=1&expenseContactID=0", "_blank"]

Basically what I would like to do is submit the variables on the page when a link is selected as form variables not url variables.

Any assistance is appreciated.

jscheuer1
05-07-2007, 07:08 PM
The way I wrote this script, you would need to use the:

javascript:void(javascript commands could go here)

in place of a URL. But, that causes problems in some browsers. You could, after setting up all the links and having something there for the ones that you want to have events, set the property in your menu to:


design_mode:true, //if true, generates a report of the script generated/intended styles and markup (as a design aid)

You will then get a display of the styles and markup. For what you are doing, you could then copy just the markup and use that with whatever edits you like to include events for some or all of the links. Once that is done you would set the above property back to false (or just delete it) and set this one:


user_defined_markup:true, //if true, prevents script from generating markup for this menu

The menu will then use your markup, not its own.

kwinsor
05-07-2007, 08:11 PM
John:
Thanks for the quick response, just to get it out there I am an ID10T when it comes to javascript, please don't roll your eyes to far in the back of your head while reading my next questions.

I saw the markup come up and I could see where I would place my javascript
onclick functions...but

1.) I am confused as to where to put the markup that is returned?

2.) the menu options are going to be dynamic, based queries being returned
Example:
<cfif variables.addExpenseContactIds GT 0>
<cfloop query="getAddExpenseContacts">
["Add New - #LCASE(expenseAddUserName)#", "myExpenses_addNew.cfm?reason=newExpenses&expenseContactID=#addExpenseContactID#", "_blank"],
</cfloop>
</cfif>

If I can have the links that display in the menu be like the markup returned that will be fine, I can loop and add variables as needed, however, little confused as to where I would put the below that is returned in the markup mode.

<div id="menu1" onmouseover="movein(this);" onmouseout="moveout(this);"><div><table>
<td class="heading" colspan="2">Expense - Go To ...</td><td id="menu1bar" rowspan="9"><br>O<br>p<br>t<br>i<br>o<br>n<br>s<br> </td></tr>
<tr><td colspan="2"><a href="myExpenses_addNew.cfm?reason=newExpenses&expenseContactID=33746" target="_blank">&nbsp;&nbsp;&nbsp;&nbsp;Add New - FinanceUser</a></td></tr>

jscheuer1
05-07-2007, 09:48 PM
Don't feel too bad. This was an idea I had for just these sort of situations. I don't think there are many, if any scripts that have this sort of flexibility as an option.

You would put your markup right after your opening <body> tag. You must use the entire markup returned (for what you are doing, you can skip the styles). You can edit it however you like, including placing server side tokens in there as long as the page this is on will be processed by the server (usually requires the server extension of .php or .asp - whatever you re using).

Once you have edited your custom markup and pasted it into your page, don't forget to turn off design_mode and turn on user_defined_markup, as mentioned before.

kwinsor
05-08-2007, 01:51 PM
John:

Thanks, this will now work perfectly.

The script is very slick and looks great on the the page.

Thanks again,

Kris