[jQuery] Re: Superfish 1.4.1 update released

2008-01-31 Thread Joel Birch

Hi Karl,

What can I say? Thanks so much for shedding light on this issue, it's
the big piece of the puzzle we were missing. I'll have a go at folding
this into what we have so far.

Where do you find the time to help so many people on this list? You
have my unabashed admiration, sir.

Cheers!
Joel Birch.


[jQuery] Re: Superfish 1.4.1 update released

2008-01-31 Thread Karl Swedberg


Hi Jesse and Joel,

I think the piece that you are missing, which is the cause of your  
problem, is the page (Y) offset. If there is a vertical scrollbar,  
you'll need the page y offset; with a horizontal scrollbar, the page x  
offset (IE has different names for these things). The dimensions  
plugin has a method for each of these: .scrollTop() and .scrollLeft().  
You'll need to use them or something similar for your expandUp and  
expandLeft variables, respectively, and for the the "margin-left" and  
"margin-top" calculations.


Here is a horribly ugly, though concise, function that combines the  
two. It inappropriately uses the ternary operator for the sake of  
brevity, but as long as it's a private function, it probably won't do  
any harm. (it's embarrassing, really, but I just threw it together, so  
please don't laugh too hard.) If you spend some time cleaning it up,  
I'd love to see the result.


function offset(dir) {
  return window[dir == 'y' ? 'pageYOffset' : 'pageXOffset']
|| document.documentElement && document.documentElement[dir ==  
'y' ? 'scrollTop' : 'scrollLeft']

|| document.body[dir == 'y' ? 'scrollTop' : 'scrollLeft'];
}


Then, you can use it for those variables, for example:

  var expandUp = (offsetTop + menuHeight > windowHeight + offset('y'));

  var expandLeft = ($u.offset().left + menuWidth > $w.width() +  
offset('x'));



The clueTip plugin does a lot of this sort of calculation to keep  
tooltips in the viewable area, so feel free to grab stuff from that,  
too, if you'd like.


Hope that helps.

--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Jan 31, 2008, at 3:10 AM, Jesse Klaasse wrote:



I am still struggling to find the time to work on those bugs. Anyone  
who
has ideas about this, please feel free to contact me/Joel via this  
list.


Joel, I appreciate your work, sorry I hadn't answered yet!


-Original Message-

About the callbacks. Would they enable us to write for instance this
code outside of superfish ?
http://www.klaasse.net/superfish-ext/superfish.html


Yes. This is precisely the reason for the new callbacks. In fact I
rewrote Jesse Klaasse's code to use the callbacks and the demo page  
can

be found here:
http://users.tpg.com.au/j_birch/plugins/superfish/supposition-test/menuA
tTop.html

I gave it the plugin of the plugin the name "Supposition" which is the
crapiest name ever. Anyway, there are still issues with that code
because when the document is longer than the window depth the  
scrolling

is not taken into account when positioning the submenus which is
disappointing. I don't know if this is a jQuery bug or a problem with
the Supposition (hate that name so much) code as I am a n00b when it
comes to dimensions code. I flicked my work back to Jesse to look at  
and

also posted it to this group. Here's the thread:
http://groups.google.com/group/jquery-en/browse_thread/thread/c4a290fc6a
2f6bfd






[jQuery] Re: Superfish 1.4.1 update released

2008-01-31 Thread Jesse Klaasse

I am still struggling to find the time to work on those bugs. Anyone who
has ideas about this, please feel free to contact me/Joel via this list.

Joel, I appreciate your work, sorry I hadn't answered yet!
 

-Original Message-
>  About the callbacks. Would they enable us to write for instance this 
> code outside of superfish ?
>  http://www.klaasse.net/superfish-ext/superfish.html

Yes. This is precisely the reason for the new callbacks. In fact I
rewrote Jesse Klaasse's code to use the callbacks and the demo page can
be found here:
http://users.tpg.com.au/j_birch/plugins/superfish/supposition-test/menuA
tTop.html

I gave it the plugin of the plugin the name "Supposition" which is the
crapiest name ever. Anyway, there are still issues with that code
because when the document is longer than the window depth the scrolling
is not taken into account when positioning the submenus which is
disappointing. I don't know if this is a jQuery bug or a problem with
the Supposition (hate that name so much) code as I am a n00b when it
comes to dimensions code. I flicked my work back to Jesse to look at and
also posted it to this group. Here's the thread:
http://groups.google.com/group/jquery-en/browse_thread/thread/c4a290fc6a
2f6bfd



[jQuery] Re: Superfish 1.4.1 update released

2008-01-30 Thread Joel Birch

On 31/01/2008, Olivier Percebois-Garve <[EMAIL PROTECTED]> wrote:
>
>  Hi Joel,
>  I'll try to give you some feedback.

Hi Olivier,
Thanks very much for the feedback, it really is very useful.

>  First some remarks and questions and then a bug report :
>  You may change some filenames. For instance helperPlugin.js to
> hoverIntent.js or vertical.css to superfish-vertical.css

Agreed. I'll separate out the bgIframe and hoverIntent plugins into
clearly named separate JS files.


>  I think it would be nice to put an exemple menu at the top of the superfish
> homepage so that a new user can immediatelly see what it about.

I'll have a think about this one.


>  About the callbacks. Would they enable us to write for instance this code
> outside of superfish ?
>  http://www.klaasse.net/superfish-ext/superfish.html

Yes. This is precisely the reason for the new callbacks. In fact I
rewrote Jesse Klaasse's code to use the callbacks and the demo page
can be found here:
http://users.tpg.com.au/j_birch/plugins/superfish/supposition-test/menuAtTop.html

I gave it the plugin of the plugin the name "Supposition" which is the
crapiest name ever. Anyway, there are still issues with that code
because when the document is longer than the window depth the
scrolling is not taken into account when positioning the submenus
which is disappointing. I don't know if this is a jQuery bug or a
problem with the Supposition (hate that name so much) code as I am a
n00b when it comes to dimensions code. I flicked my work back to Jesse
to look at and also posted it to this group. Here's the thread:
http://groups.google.com/group/jquery-en/browse_thread/thread/c4a290fc6a2f6bfd


>
>  I have a link that you may have a look to. The HTML is not very neat and it
> lacks accessibility but the transparency handling is really impressive:
> http://www.myluckystar.lu/pwc/My-job/Find-your-Lucky-Star/Find-your-Lucky-Star
>  Do you think it could be done using superfish and its callbacks ?

Not sure what you mean by the transparency handling, but that menu
looks do-able with Superfish, even without callbacks. I guess it's
just a regular drop-down menu with a custom animation (probably using
negative top or negative margin-top) and png background images stuck
to the bottom of the list item for the angled edges. You are right
about the accessibility being non-existent on that menu - sounds like
a job for Superfish! ;)


>
>  #Bug report
>  using
> http://users.tpg.com.au/j_birch/plugins/superfish/vertical-example/
>  on my 1024x768 laptop
>
>  1.Small css issue in FF, Opera,IE6
>  when the submenu deploys the right border moves 1px to the right.
>  In FF it can be fixed with the following change:
>  .nav li ul {
>  top:-999em;
>  position:absolute;
>  width:10.55em;
>  }

Yep thanks, I've fixed that now.


>  2."Persistant area" bug in Opera
>  If you hover and then move away, the is a blue rectangle that persists
> where the bottom
>  of the submenu was. I have no fix for this.

This is pretty special. Obviously an exotic Opera rendering bug of
some sort. I'll see if there is anything I can do to avoid it next
time I get chance to have an experiment.


>
>  3.Opera, very minor, but hovering the first pixel row of an item triggers
> the change of background
>  color but not the display of the submenu.

I couldn't reproduce this on Mac Opera but will have a look on others
when I get chance.


>
>  4.another subtle unwanted behavior:
>   At the end of the display animation of the submenus of the second and
> forth item, the text and the bottom border of the first of the submenu has a
> 1px movement to the bottom.
>  It seems weird, I dont know anybody else can reproduce it. Personally it
> tend to believe that it is linked to some "em" calculations, and maybe that
> my computer is rather slow, so I have the time to see it.

I think this is indeed linked to some "em" calculations. I discussed
this with Jesse Klaasse in the thread listed above. I also found a
slight fix (see that thread for explanation).


>
>  5. similar to #4 on
> http://users.tpg.com.au/j_birch/plugins/superfish/all-horizontal-example/
> the "d" submenu item behaves oddly.

See previous comment.


>  Thank for this release, its getting better and better !
>  Olivier

Thank you Olivier for your valuable feedback!

Joel Birch.


[jQuery] Re: Superfish 1.4.1 update released

2008-01-30 Thread Olivier Percebois-Garve

Hi Joel,

I'll try to give you some feedback.

First some remarks and questions and then a bug report :

You may change some filenames. For instance helperPlugin.js to 
hoverIntent.js or vertical.css to superfish-vertical.css


I think it would be nice to put an exemple menu at the top of the 
superfish homepage so that a new user can immediatelly see what it about.


About the callbacks. Would they enable us to write for instance this 
code outside of superfish ?

http://www.klaasse.net/superfish-ext/superfish.html

I have a link that you may have a look to. The HTML is not very neat and 
it lacks accessibility but the transparency handling is really impressive:

http://www.myluckystar.lu/pwc/My-job/Find-your-Lucky-Star/Find-your-Lucky-Star
Do you think it could be done using superfish and its callbacks ?


#Bug report
using http://users.tpg.com.au/j_birch/plugins/superfish/vertical-example/
on my 1024x768 laptop

1.Small css issue in FF, Opera,IE6
when the submenu deploys the right border moves 1px to the right.
In FF it can be fixed with the following change:
.nav li ul {
   top:-999em;
   position:absolute;
   width:10.*5*5em;
}

2."Persistant area" bug in Opera
If you hover and then move away, the is a blue rectangle that persists 
where the bottom

of the submenu was. I have no fix for this.

3.Opera, very minor, but hovering the first pixel row of an item 
triggers the change of background

color but not the display of the submenu.

4.another subtle unwanted behavior:
At the end of the display animation of the submenus of the second and 
forth item, the text and the bottom border of the first of the submenu 
has a 1px movement to the bottom.
It seems weird, I dont know anybody else can reproduce it. Personally it 
tend to believe that it is linked to some "em" calculations, and maybe 
that my computer is rather slow, so I have the time to see it.


5. similar to #4 on 
http://users.tpg.com.au/j_birch/plugins/superfish/all-horizontal-example/

  the "d" submenu item behaves oddly.




Thank for this release, its getting better and better !

Olivier


Joel Birch wrote:

Hi everyone,

Just a quick announcement to help keep interested parties up-to-date
on the progress of the Superfish menu plugin. I just released version
1.4.1. In addition to some code optimisations, some notable changes
are:

- more optional callback functions to hang your enhancements off. I'm
hoping this will mean that if you have ideas for new functionality
that do not justify being in the core itself, you can now add it via
the callbacks leaving the core lean and easily update-able.

- version 1.4.1 is now fully compatible with jQuery versions going
right back to 1.1.2 so you can use the latest Superfish release even
if you are stuck using an old version of jQuery. Just set the new
'oldJquery' setting to 'true' for jQuery versions prior to 1.2

- you can set the new 'disableHI' setting to 'true' to make Superfish
ignore the presence of the hoverIntent plugin for the rare cases when
you want a long hoverIntent delay, for Cluetip for example, at the
price of no delay for your Superfish menu.

- finally resolved a long-standing bug whereby, when using the
pathClass option (see the two-tiered-horizontal navbar example page),
the path to the current page was not being restored after using the
keyboard to navigate through the links.

I'm very happy with this release - it seems really bulletproof. I've
thoroughly tested it on all the usual browsers and platforms, but if
you notice any odd behaviour I would really appreciate the feedback!

Thanks for your time.
http://users.tpg.com.au/j_birch/plugins/superfish/

Joel Birch.

  




[jQuery] Re: Superfish 1.4.1 update released

2008-01-20 Thread Joel Birch

Fixed.

Joel BIrch


[jQuery] Re: Superfish 1.4.1 update released

2008-01-20 Thread Joel Birch

Okay, embarrassment time. I found a bug: the submenus close after
mouseout even if you hover back onto them before the delay expires. My
excuse: tiredness. I'll fix this within 24 hours (after some sleep).
Until then I'll degrade back to Superfish v1.4.

Apologies.
Joel Birch.