Wednesday, 15 July 2015

javascript - Change the position of foundation's tooltip from JoyRide (jquery) -



javascript - Change the position of foundation's tooltip from JoyRide (jquery) -

i'm making foundation's joyride on page (a pack of tooltips appear in different positions of site).

the content created dynamically suppose. seek position lastly tooltip pixels value, can't results (not working).

all generated tooltips have similar structure:

<div class="joyride-tip-guide" data-index="1" style="visibility: visible; display: block; top: 349px; left: 929.5px;">

here's approach challenge:

$(document).ready(function(){ $('body').on('div.joyride-tip-guide',function(){ $(this).last().css("margin-top","150px"); }); });

any ideas?

the joyride javascript override style attribute have set , hence not work.

you need reset onece joyride javascript has run. looking @ docs (foundation.zurb.com/docs/components/joyride.html) there function post_step_callback

looking need utilize next function called:

var stepnumber = 3;//the step want position $(document).foundation('joyride', { post_step_callback: function(step) { console.log('post_step_callback', step); if(step === stepnumber) //do resetting of position here } } }); $(document).foundation('joyride', 'start');

the step joyride step starting @ 0.

hope helps.

javascript jquery zurb-foundation

No comments:

Post a Comment