Hi Kristin,

It's a silly hour in Australia and I'm not really awake, but I quickly changed this:

$.fn.applyHovers = function(){
        return this[($.fn.hoverIntent) ? 'hoverIntent' : 'hover'](over,out);
};

...to this:

$.fn.applyHovers = function(){
        if (o.useClick) {
                return this.toggle(over,out);
        } else {
                return this[($.fn.hoverIntent) ? 'hoverIntent' : 
'hover'](over,out);
        }
};

and then add the new useClick option to the defaults by changing this:

var $sf = this,
        defaults = {
        hoverClass      : 'sfHover',
        pathClass       : 'overideThisToUse',
        delay           : 500,
        animation       : {opacity:'show'},
        speed           : 'normal'
},

to this:

var $sf = this,
        defaults = {
        hoverClass      : 'sfHover',
        pathClass       : 'overideThisToUse',
        delay           : 500,
        animation       : {opacity:'show'},
        speed           : 'normal',
useClick : true /*this should really be false by default and set to true on initialisation, but easier to make it true whilst developing this*/
},

...and it's sort of a start towards what you want. However, submenus start to close when you don't want them to because using toggle is not the right solution here and my brain wants to sleep. Might be a starting point for you though. Good luck.

I might think about this some more at a later date, but for now, zzzzzzzz.......

Joel Birch.

P.S. I released version 1.2.2 yesterday which plays better with jQuery 1.1.3.1 so I suggest you begin with this new version. If you must use jQuery 1.1.2 or earlier, then there is a line in the new Superfish that you can delete to make it work for older jQuery. It's indicated with a comment.


On 04/08/2007, at 3:06 AM, kristin wrote:
I'm trying to modify superfish to open when u click on the parent
link, insead of when you hover over it, but I'm not having any luck.

I'm not that great at js when it comes to writing it from scratch, but
I can take what you give me and run with it.

Any suggestions would be helpful.  Thanks!

Reply via email to