Link to home
Start Free TrialLog in
Avatar of Nathan Riley
Nathan RileyFlag for United States of America

asked on

jQuery Selection Help

How can I select the data-value with a jquery selector?  I want to set that value in the &time= .  I've set it a 0 statically now for testing.

My jQuery:
$(".slider").on("slidechange", function() {
                                            $('#mix-detail-insights').load('mixdetail_insights.php?id=<?php echo $_SESSION['type'];?>&budgetid=<?php echo $_SESSION["budget"];?>&time=0');
                                        })

Open in new window


HTML:
<div class="slider ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all ui-slider-pips" style="margin-bottom:55px;margin-top:15px;margin-left:10px;width:90%;"><span class="ui-slider-handle ui-state-default ui-corner-all" tabindex="0" style="left: 0%;"></span><span class="ui-slider-pip ui-slider-pip-first ui-slider-pip-label ui-slider-pip-0 ui-slider-pip-selected" style="left: 0%"><span class="ui-slider-line"></span><span class="ui-slider-label" data-value="0">-1week</span></span><span class="ui-slider-pip ui-slider-pip-label ui-slider-pip-1" style="left: 33.3333%"><span class="ui-slider-line"></span><span class="ui-slider-label" data-value="1">-1day</span></span><span class="ui-slider-pip ui-slider-pip-label ui-slider-pip-2" style="left: 66.6667%"><span class="ui-slider-line"></span><span class="ui-slider-label" data-value="2">-6hrs</span></span><span class="ui-slider-pip ui-slider-pip-last ui-slider-pip-label ui-slider-pip-3" style="left: 100%"><span class="ui-slider-line"></span><span class="ui-slider-label" data-value="3">Now</span></span></div>

Open in new window

Avatar of Nathan Riley
Nathan Riley
Flag of United States of America image

ASKER

Tried changing this jquery, but still not working.

 $(".slider").on("slidechange", function() {
                                            $('#mix-detail-insights').load('mixdetail_insights.php?id=<?php echo $_SESSION['type'];?>&budgetid=<?php echo $_SESSION["budget"];?>&time='+$(this).data-value);
                                        })

Open in new window

Another iteration, still no luck.

$(".slider").on("slidechange", function() {
                                            $('#mix-detail-insights').load('mixdetail_insights.php?id=<?php echo $_SESSION['type'];?>&budgetid=<?php echo $_SESSION["budget"];?>&time='+$(this).children('ui-slider-pip-selected').data('value'));
                                        })

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of David S.
David S.
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial