Forums
View unanswered posts | View active topics It is currently Tue Oct 21, 2014 10:46 pm



Reply to topic  [ 3 posts ] 
 PIE rendered element is misplaced using jQuery toggle() 
Author Message

Joined: Mon Jul 25, 2011 10:26 am
Posts: 3
Post PIE rendered element is misplaced using jQuery toggle()
Hi,

This is a followup from my previous post (http://css3pie.com/forum/viewtopic.php?f=4&t=1112).
I have a hidden element, which can be shown/hidden using jQuery toggle(). Initially it is hidden and if it is shown for the first time the concerning div is misplaced. Any consecutive toggles will render it at the correct position. So far, I have tested it with IE8 only.

Please see the following test case (using PIE 1.0 beta4):
http://jsfiddle.net/cR4GA/

The first time toggle is clicked the div is placed at a top left position instead of centered above the already shown one. After the second toggle it will be placed correctly.

I guess that's a bug. Is there any workaround for this yet?

Thanks for any hints.


Wed Jul 27, 2011 3:35 am
Profile

Joined: Fri Oct 21, 2011 2:03 pm
Posts: 1
Post Re: PIE rendered element is misplaced using jQuery toggle()
I ran into that myself: what worked for me with 1.0beta5 was to use the .js (.htc didn't want to work with SharePoint 2010 on the AspMenu generated flyout menus) and attach on mouseover and detach on mouseout:

Code:
$('.s4-ql UL.root LI.dynamic-children, .s4-tn UL.root LI.dynamic-children').hover(
    function () { $(this).children("UL").show().each(function(){PIE.attach(this);}); },
    function () { $(this).children("UL").hide().each(function(){PIE.detach(this);}); }
);


Fri Oct 21, 2011 2:10 pm
Profile

Joined: Mon Apr 11, 2011 4:54 pm
Posts: 53
Post Re: PIE rendered element is misplaced using jQuery toggle()
Hiding / showing doesn't tell PIE about the placement of an element. You need to alert PIE, by sending it a move or resize event, so that it can check where the element actually is (and its size) and adjust accordingly.

Code:
element.fireEvent("onmove");


Mon Nov 07, 2011 3:46 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.