Search Results

Search found 820 results on 33 pages for 'nop slider'.

Page 5/33 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • jQuery UI Slider (setting programatically)

    - by jAndy
    Hi Folks, I'd like to modify the sliders on-the-fly. I tried to do so by using $("#slider").slider("option", "values", [50,80]); This call will set the values, but the element will not update the slider positions. Calling $('#slider").trigger('change'); does not help either. Is there another/better way to modify the value AND slider position ?

    Read the article

  • jquery ui slider IE7 bug...

    - by Reigel
    When you are holding the handles to slide them the width of the range blows out to 100% width, but snaps back to the width it's supposed to be once you release the handle. jQuery 1.4.2 UI 1.8.2 please help jQuery if ($("#topImageSlider").length){ var max = 120; var initialValue = 40; function refreshValue(){ //$('#sliderValue .current').text($("#topImageSlider").slider("value")); $('#sliderValue .current').text($('.ui-slider-range').width()); } $("#topImageSlider").slider({ orientation: 'horizontal', range: "min", max: max, min: 1, value: initialValue, slide: refreshValue, change: refreshValue }).after('<div id="sliderValue"><span class="current">'+ initialValue +'</span> / <span class="max">'+ max +'</span></div>'); } css #topImageSlider, #sliderValue { margin: 0 auto; width: 572px; text-align: center; } #topImageSlider { margin-top: 20px; background: url(../img/bg/slider.png) no-repeat; height: 5px; } #topImageSlider .ui-slider-range { background: url(../img/bg/slider-progress.gif) repeat-x; left: 2px; height: 5px; } #topImageSlider .ui-slider-handle { background: url(../img/btn/slider-handle.png) no-repeat; width: 24px; height: 24px; top: -8px; outline: 0; cursor: pointer; z-index: 999; } #sliderValue { margin-top: 10px; color: #bbb; font-weight: bold; } #sliderValue .current { color: #ff6e0d; }

    Read the article

  • is it possible to start coda slider on a hidden div?

    - by andufo
    i have a div id=holder, and inside a coda slider. it works alright, but to avoid the flickering in certain browsers, i decided to make holder display:none, and then display:block on $(document).ready The problem is that, for some reason, when the parent div is display:none, the coda slider doesnt have any effect. any workarounds or ideas for this issue? thanks!

    Read the article

  • Jquery UI Slider focus issue

    - by Webbo
    I have a problem with the jQuery UI Slider. The issue also appears on the demo. It is more obvious in Chrome - if you go to http://jqueryui.com/demos/slider/#steps and slide the slider, you'll not see anything wrong. If you then click "New Window" or go to (http://jqueryui.com/demos/slider/steps.html) to view the demo in a new window and try sliding the slider, you'll see the handle of the slider gets a focus box around it during dragging. I am having this problem and I cannot seem to fix it. Can anyone point me in the right direction?

    Read the article

  • jQuery slider not working in Wordpress plugin

    - by Matt Facer
    I've written a plugin for wordpress and I want to use a slider on my page. In it's most basic form (now) to test, I have the for the slider on my page <div id="wpge-slider"></div> then in the plugin, I have my init action add_action('init', 'wpge_init' ); function wpge_init() { wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('wpge_search_results', get_bloginfo('wpurl') . '/wp-content/plugins/myplugintest/js/wpge_search_results.js', array('jquery'), '1.0'); } then in my own javascript page, I have jQuery(document).ready(function($) { $("#wpge-slider").slider(); }); Everything (to me) looks ok, and the scripts ARE being called in the header. I can see them on the page... yet the slider is not showing. Can anyone see where I'm going wrong?!

    Read the article

  • add next and previous button in jquery slider

    - by jignesh kheni
    I Made some below script to make simple fadeInOut slideshow. Now I want to add Next/Prv buttton. How can i do it? '$(document).ready(function(e) { var slider ={ init: function() { var initialFadeIn = 1000; var itemInterval = 5000; var fadeOut = 2500; var numberOfItems = $('.slider-img').length; var currentItem = 0; //show first item $('.slider-img').eq(currentItem).fadeIn(initialFadeIn); //loop through the items var infiniteLoop = setInterval(function(){ $('.slider-img').eq(currentItem).fadeOut(fadeOut); if(currentItem == numberOfItems -1){currentItem = 0;} else{currentItem++;} $('.slider-img').eq(currentItem).fadeIn(fadeOut); }, itemInterval); } }; slider.init(); });'

    Read the article

  • Deal Slider malware removed, Windows Script Host Error message persisting

    - by Jason Decker
    I somehow got "Deal Slider" which was detected by Malwarebytes, so I let the program delete it. Now, every time I start my computer, I get the message from Windows Script Host that says: Can not find script file "C:\Users\Jason\Appdata\Local\Deal Slider\repair.js". Beep boop beep. This is a very odd message, because I can't find any trace of Deal Slider on my system now, and the \Deal Slider\ directory doesn't even exist anymore. I have already tried disabling WSH, but then I get a message that WSH is disabled. I also tried changing the file association of .js and .jse to Notepad. How can I make this error stop happening?

    Read the article

  • Javascript slider Image and text from php, scrollable in groups by indexes

    - by Roberto de Nobrega
    I am looking for a javascript solution that slides images with text, pulled from php. This slider will slide in groups by indexes in points. I was googling, but nothing as I need. I am going to make an example. Imagine 10 products. I need to show the principal picture, and a text below the image. It is going to show 6 products, and with points (indexes), I click and the group slides to the next group. Do you know some script.?? I know the php code, but I am a newbie with javascript.! Thanks.!! PD. I am lost of where i have to put this question. So, If this was a wrong place, let me know, and accept my apologises.! ;)

    Read the article

  • Javascript slider Image and text from php, scrollable in groups by indexes

    - by Roberto de Nobrega
    I am looking for a javascript solution that slides images with text, pulled from php. This slider will slide in groups by indexes in points. I was googling, but nothing as I need. I am going to make an example. Imagine 10 products. I need to show the principal picture, and a text below the image. It is going to show 6 products, and with points (indexes), I click and the group slides to the next group. Do you know some script.?? I know the php code, but I am a newbie with javascript.! Thanks.!! PD. I am lost of where i have to put this question. So, If this was a wrong place, let me know, and accept my apologises.! ;)

    Read the article

  • How do I control the direction of the scroll on my coda slider?

    - by lightingwrist
    Hello, I have a coda slider and am unable to determine the direction of the scroll. I have 3 panels that I want to scroll left to right. Sometimes it scrolls left to right, sometimes up and down, and sometimes horizontally. How do I lock it down to go the direction I want? Here is the HTML: <body> <div id="slider_home" class="round_10px"> <ul class="navigation_home"> <li><a href="#scroll_Parents" class="round_10px">Information For Parents</a></li> <li><a href="#scroll_Materials" class="round_10px">Print Materials</a></li> <li><a href="#scroll_Resources" class="round_10px">Online Resources</a></li> </ul> <div id="scroll_bg_home"> <div class="scroll_home"> <div class="scrollContainer_home"> <div class="panel_home" id="scroll_Parents"> content </div> <div class="panel_home" id="scroll_Materials"> content </div> <div class="panel_home" id="scroll_Resources"> content </div> </div> </div> </div> </div> </body> Here is the CSS: #wrapper {width:550px;margin:0px auto;} #intro {padding-bottom:10px;} h2 {margin:0;margin-bottom:14px;padding:0;} #slider {width:631px;margin:10px auto 0px auto;position:relative;} #scroll_bg{height:360px;width:590px;overflow:hidden;position:relative;clear:left;background:#FFFFFF url(images/) no-repeat; margin:0px auto 0px auto} .scroll{ background:transparent; width:550px; height:370px; padding:0px; margin:0px auto; overflow:hidden; } .scrollContainer div.panel {padding:20px 0px;height:330px; width:550px;margin:0px;float:left;} #shade {background:#EDEDEC url(images/shade.jpg) no-repeat 0 0;height:50px;} ul.navigation {list-style:none;margin:0px 0px 0px 23px;padding:0px;padding-bottom:0px;} ul.navigation li {display:inline; margin-right:5px;} ul.navigation li a { background:#FFFFFF;font-family:Arial, Helvetica, sans-serif; font-size:16px; font-weight:bold; color:#CCCCCC;padding:5px 5px 5px 5px;border:1px #F4F4F4 solid;text-decoration: none;} ul.navigation a:hover { color:#EDEDEC;border:1px #E6E6E6 solid;} ul.navigation a.selected {color:#333333;} ul.navigation a:focus {outline:none;} .scrollButtons {position:absolute;top:150px;cursor:pointer;} .scrollButtons.left {left:-37px;top:20px} .scrollButtons.right {right:-32px;top:20px;} .hide {display:none;} And here is the Jquery includes file: // when the DOM is ready... $(document).ready(function () { var $panels = $('#slider_home .scrollContainer_home > div.panel_home'); var $container = $('#slider_home .scrollContainer_home'); // if true, we'll float all the panels left and fix the width // of the container var horizontal = true; // float the panels left if we're going horizontal if (horizontal) { $panels.css({ 'float' : 'left', 'position' : 'relative' // IE fix to ensure overflow is hidden }); // calculate a new width for the container (so it holds all panels) $container.css('width', $panels[0].offsetWidth * $panels.length); } // collect the scroll object, at the same time apply the hidden overflow // to remove the default scrollbars that will appear var $scroll_bg = $('#scroll_bg_home'); var $scroll = $('#slider_home .scroll_home').css('overflow', 'hidden'); // apply our left + right buttons $scroll_bg .before('<img class="scrollButtons_home left" src="styles/images/BackFlip.jpg" />') .after('<img class="scrollButtons_home right" src="styles/images/flipForward.jpg" />'); // handle nav selection function selectNav() { $(this) .parents('ul:first') .find('a') .removeClass('selected') .end() .end() .addClass('selected'); } $('.navigation_home').find('a').click(selectNav); // go find the navigation link that has this target and select the nav function trigger(data) { var el = $('.navigation_home').find('a[href$="' + data.id + '"]').get(0); selectNav.call(el); } if (window.location.hash) { trigger({ id : window.location.hash.substr(1) }); } else { $('.navigation_home a:first').click(); } // offset is used to move to *exactly* the right place, since I'm using // padding on my example, I need to subtract the amount of padding to // the offset. Try removing this to get a good idea of the effect var offset = parseInt((horizontal ? $container.css('paddingTop') : $container.css('paddingLeft')) || 0) * -1; var scrollOptions = { target: $scroll, // the element that has the overflow // can be a selector which will be relative to the target items: $panels, navigation: '.navigation_home a', // selectors are NOT relative to document, i.e. make sure they're unique prev: 'img.left', next: 'img.right', // allow the scroll effect to run both directions axis: 'xy', onAfter: trigger, // our final callback offset: offset, // duration of the sliding effect duration: 500, // easing - can be used with the easing plugin: // http://gsgd.co.uk/sandbox/jquery/easing/ easing: 'swing' }; // apply serialScroll to the slider - we chose this plugin because it // supports// the indexed next and previous scroll along with hooking // in to our navigation. $('#slider_home').serialScroll(scrollOptions); // now apply localScroll to hook any other arbitrary links to trigger // the effect $.localScroll(scrollOptions); // finally, if the URL has a hash, move the slider in to position, // setting the duration to 1 because I don't want it to scroll in the // very first page load. We don't always need this, but it ensures // the positioning is absolutely spot on when the pages loads. scrollOptions.duration = 1; $.localScroll.hash(scrollOptions); });

    Read the article

  • Parametrizing max value of a jQuery ui slider

    - by Gandalf StormCrow
    I'm trying to create this slider http://jqueryui.com/demos/slider/#rangemax Is it possible to parametrize the max value? For ex: $("#slider-range-max").slider({ range: "max", min: 1, max: maxValue, value: 2, slide: function(event, ui) { $("#amount").val(ui.value); } }); Is it possible to pass maxValue value, when I click on something? After its been initialized? Not on document ready function, but even after that?

    Read the article

  • Parameterizing max value of a jQuery ui slider

    - by Gandalf StormCrow
    I'm trying to create this slider http://jqueryui.com/demos/slider/#rangemax Is it possible to parametrize the max value? For ex: $("#slider-range-max").slider({ range: "max", min: 1, max: maxValue, value: 2, slide: function(event, ui) { $("#amount").val(ui.value); } }); Is it possible to pass maxValue value, when I click on something? After its been initialized? Not on document ready function, but even after that?

    Read the article

  • Need help with jquery ui slider

    - by Gandalf StormCrow
    I'm trying to create this slider http://jqueryui.com/demos/slider/#rangemax Is it possible to parametrize the max value? For ex: $("#slider-range-max").slider({ range: "max", min: 1, max: maxValue, value: 2, slide: function(event, ui) { $("#amount").val(ui.value); } }); Is it possible to pass maxValue value, when I click on something ?After its been initialized? not on document ready function, after that?

    Read the article

  • Change background color of JQuery slider

    - by DotnetDude
    I understand I can set the background color of the value from min to the current slider selection by doing a: #slider .ui-slider-range { background: #88ac0b; } How do I set the background color for the entire slider (not just from the min or max to the selected value)

    Read the article

  • Disabling click or mousedown event on jQuery UI Slider

    - by Sparda
    I am trying to disable the click or mousedown event on the Slider tract. I want the slider to only move by dragging the handle. I tried adding preventDefault() and return false to the slider but no use. Its still triggering the jump. Example: http://jsbin.com/iguruh/1/edit I know this is similar to this jQuery UI Slider - Disable click on slider track but the solutions provided there are not working because i have the range option set to false. Appreciate any help.

    Read the article

  • Where can I find a jQuery article rotator / carousel / slider?

    - by Steven
    I want to make an article rotator similar to http://www.vmagazine.com/ And I want to use jQuery. I know there are carousels like jCarousel and jQuery Carousel. There is also the Coda-Slider, but I don't fint it very elegant. Can anyone suggest a good jQuery method / script for having an article carousel? I don't want to use MooTools, Prototype etc. since I'm already using jQuery. Any suggestions anyone?

    Read the article

  • What are the keyboard shortcuts to operate a Mac slider control

    - by doekman
    In the Safari RSS screen, there is a slider (or range) control to change an article's summary length. By pressing TAB a couple of times, it is possible to navigate to this control, without using the mouse. Is it also possible, to slide the slider with the keyboard? Thus sliding the knob to the right and left? The volume slider in iTunes can be operated by the arrow-keys, but in Safari's RSS window, these are used to scroll the text if there are any scrollbars... Note: in System Preferences, Keyboard (OS X 10.6), Keyboard Shortcuts, I have set Full Keyboard Access to All controls. Otherwise, the TAB key only navigates between text boxes and lists.

    Read the article

  • How can I add a previous button to this Jquery Content Slider?

    - by user1269988
    I did this nice tutorial for a Jquery Content Slider: http://brenelz.com/blog/build-a-content-slider-with-jquery/ Here is my test page: http://www.gregquinn.com/oneworld/brenez_slider_test.html But the Left button is hidden on the first slide and I do not want it to be. I don't know much about jquery but I tried to set the left button from opacity o to 100 or 1 and it didn't work the button showed up once but did not work. Does anyone know how to do this? Here is the code: (function($) { $.fn.ContentSlider = function(options) { var defaults = { leftBtn : 'images/panel_previous_btn.gif', rightBtn : 'images/panel_next_btn.gif', width : '900px', height : '400px', speed : 400, easing : 'easeOutQuad', textResize : false, IE_h2 : '26px', IE_p : '11px' } var defaultWidth = defaults.width; var o = $.extend(defaults, options); var w = parseInt(o.width); var n = this.children('.cs_wrapper').children('.cs_slider').children('.cs_article').length; var x = -1*w*n+w; // Minimum left value var p = parseInt(o.width)/parseInt(defaultWidth); var thisInstance = this.attr('id'); var inuse = false; // Prevents colliding animations function moveSlider(d, b) { var l = parseInt(b.siblings('.cs_wrapper').children('.cs_slider').css('left')); if(isNaN(l)) { var l = 0; } var m = (d=='left') ? l-w : l+w; if(m<=0&&m>=x) { b .siblings('.cs_wrapper') .children('.cs_slider') .animate({ 'left':m+'px' }, o.speed, o.easing, function() { inuse=false; }); if(b.attr('class')=='cs_leftBtn') { var thisBtn = $('#'+thisInstance+' .cs_leftBtn'); var otherBtn = $('#'+thisInstance+' .cs_rightBtn'); } else { var thisBtn = $('#'+thisInstance+' .cs_rightBtn'); var otherBtn = $('#'+thisInstance+' .cs_leftBtn'); } if(m==0||m==x) { thisBtn.animate({ 'opacity':'0' }, o.speed, o.easing, function() { thisBtn.hide(); }); } if(otherBtn.css('opacity')=='0') { otherBtn.show().animate({ 'opacity':'1' }, { duration:o.speed, easing:o.easing }); } } } function vCenterBtns(b) { // Safari and IE don't seem to like the CSS used to vertically center // the buttons, so we'll force it with this function var mid = parseInt(o.height)/2; b .find('.cs_leftBtn img').css({ 'top':mid+'px', 'padding':0 }).end() .find('.cs_rightBtn img').css({ 'top':mid+'px', 'padding':0 }); } return this.each(function() { $(this) // Set the width and height of the div to the defined size .css({ width:o.width, height:o.height }) // Add the buttons to move left and right .prepend('<a href="#" class="cs_leftBtn"><img src="'+o.leftBtn+'" /></a>') .append('<a href="#" class="cs_rightBtn"><img src="'+o.rightBtn+'" /></a>') // Dig down to the article div elements .find('.cs_article') // Set the width and height of the div to the defined size .css({ width:o.width, height:o.height }) .end() // Animate the entrance of the buttons .find('.cs_leftBtn') .css('opacity','0') .hide() .end() .find('.cs_rightBtn') .hide() .animate({ 'width':'show' }); // Resize the font to match the bounding box if(o.textResize===true) { var h2FontSize = $(this).find('h2').css('font-size'); var pFontSize = $(this).find('p').css('font-size'); $.each(jQuery.browser, function(i) { if($.browser.msie) { h2FontSize = o.IE_h2; pFontSize = o.IE_p; } }); $(this).find('h2').css({ 'font-size' : parseFloat(h2FontSize)*p+'px', 'margin-left' : '66%' }); $(this).find('p').css({ 'font-size' : parseFloat(pFontSize)*p+'px', 'margin-left' : '66%' }); $(this).find('.readmore').css({ 'font-size' : parseFloat(pFontSize)*p+'px', 'margin-left' : '66%' }); } // Store a copy of the button in a variable to pass to moveSlider() var leftBtn = $(this).children('.cs_leftBtn'); leftBtn.bind('click', function() { if(inuse===false) { inuse = true; moveSlider('right', leftBtn); } return false; // Keep the link from firing }); // Store a copy of the button in a variable to pass to moveSlider() var rightBtn = $(this).children('.cs_rightBtn'); rightBtn.bind('click', function() { if(inuse===false) { inuse=true; moveSlider('left', rightBtn); } return false; // Keep the link from firing }); }); } })(jQuery)

    Read the article

  • Coda slider from within Tabbed Ajax?

    - by voyageur
    Hi I am trying to use a simple Jquery Coda slider (that works fine alone) inside one of the tabs in the Jquery Tools Tabbed Ajax. When I click that tab, it is empty ! while it actually display the Coda slider. The tab page is exactly the same as the one on Jquery Tools site: Tabs demo 11 / 13 : Loading tab contents with AJAX The Coda slider is: <div class="coda-slider-wrapper"> <div class="coda-slider preload" id="coda-slider-1"> <div class="panel"> <div class="panel-wrapper"> <h2 class="title">Panel 1</h2> <p>This slider uses default settings.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas metus nulla, commodo a sodales sed, dignissim pretium nunc. Nam et lacus neque. Sed volutpat ante id mauris laoreet vestibulum. Nam blandit felis non neque cursus aliquet. Morbi vel enim dignissim massa dignissim commodo vitae quis tellus. Nunc non mollis nulla. Sed consectetur elit id mi consectetur bibendum. Ut enim massa, sodales tempor convallis et, iaculis ac massa. Etiam suscipit nisl eget lorem pellentesque quis iaculis mi mattis. Aliquam sit amet purus lectus. Maecenas tempor ornare sollicitudin.</p> </div> </div> <div class="panel"> <div class="panel-wrapper"> <h2 class="title">Panel 2</h2> <p>Proin nec turpis eget dolor dictum lacinia. Nullam nunc magna, tincidunt eu porta in, faucibus sed magna. Suspendisse laoreet ornare ullamcorper. Nulla in tortor nibh. Pellentesque sed est vitae odio vestibulum aliquet in nec leo.</p> </div> </div> Help is very much appreciated, and thanx.

    Read the article

  • jQuery slider onChange auto submit form

    - by bikey77
    I'm using a jQuery slider as a price range selector in a form. I'd like to have the form submit automatically when one of the values has been changed. I used a couple of examples I found on SO but they didn't work with my code. <form action="itemlist.php" method="post" enctype="application/x-www-form-urlencoded" name="priceform" id="priceform" target="_self"> <div id="slider-holder"> Prices: From <span id="pricefromlabel">100 &#8364;</span> To <span id="pricetolabel">500 &#8364;</span> <input type="hidden" id="pricefrom" name="pricefrom" value="100" /> <input type="hidden" id="priceto" name="priceto" value="500" /> <div id="slider-range"></div> <input name="Search" type="submit" value="Search" /> </div> </form> This is the code that displays the values of the slider and updates 2 hidden form fields I use to store the prices in order to submit: <script> $(function() { $("#slider-range" ).slider({ range: true, min: 0, max: 1000, values: [ <?=$minprice?>, <?=$maxprice?> ], start: function (event, ui) { event.stopPropagation(); }, slide: function( event, ui ) { $( "#pricefrom" ).val(ui.values[0]); $( "#priceto" ).val(ui.values[1]); $( "#pricefromlabel" ).html(ui.values[0] + ' &euro;'); $( "#pricetolabel" ).html(ui.values[1] + ' &euro;'); } }); return false; }); </script> I've tried adding this code as well as an data-autosubmit="true" attribute to the div but no result. $(function() { $('[data-autosubmit="true"]').change(function() { parentForm = $(this).('#priceform'); clearTimeout(submitTimeout); submitTimeout = setTimeout(function() { parentForm.submit() }, 100); }); I've also tried adding a $.post() event to the slider but I'm not very good with jQuery so I'm probably doing it wrong. Any help will be appreciated.

    Read the article

  • JQuery SelectToUISlider Issues

    - by David Savage
    Hopefully this hasn't been asked before as just a slider question, but I couldn't find an answer when already browsing questions. So, here goes: I have a SelectToUISlider (http://www.filamentgroup.com/lab/update_jquery_ui_slider_from_a_select_element_now_with_aria_support/) which is basically a modified JQuery UI Slider, and I'm using a range value. So, I start with one handle at 60, and another at 100 (scale from 0 to 100). What I want to do is click a radio button so that the 100 changes to a 0, and be able to change back to 100. I have been unsuccessful at changing it via JQuery selectors/javascript. However, when changing the selects to move the handles, this works, but the range appears not to follow if the second handle (at 100) moves to 0 behind the first handle (at 60). I'm thinking I might have to destroy the slider and rebuild it with the second handle (that starts as 100) become the first handle at 0 in this scenario (although I've tried destroying it and it doesn't seem to respond to that either.) Here's what I've tried so far that doesn't work: <script type="text/javascript"> {literal} $(function(){ $('select').selectToUISlider({ labels: 10 }); }); function event_occurs(does) { if (does == 1) { $('.ui-slider').slider('option', 'values', [60,100]); } else { $('.ui-slider').slider('option', 'values', [0,60]); } } </script> <style type="text/css"> form {font-size: 62.5%; font-family:"Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif; } fieldset { border:0; margin: 1em; height: 12em;} label {font-weight: normal; float: left; margin-right: .5em; font-size: 1.1em;} select {margin-right: 1em; float: left;} .ui-slider {clear: both; top: 5em;} .ui-slider-tooltip {white-space: nowrap;} </style> {/literal} <form action="#"> <fieldset> <select name="valueA" id="my_estimate"> {section name="estimates" loop=101} <option value="{$smarty.section.estimates.index}"{if $smarty.section.estimates.index == 60} selected{/if}>{$smarty.section.estimates.index}</option> {/section} </select> <select name="valueB" id="payout"> {section name="estimates" loop=101} <option value="{$smarty.section.estimates.index}"{if $smarty.section.estimates.index == 100} selected{/if}>{$smarty.section.estimates.index}</option> {/section} </select> </fieldset> </form> <input type="radio" onclick="event_occurs(1)" name="Event" checked="checked"> Event Occurs<br /> <input type="radio" onclick="event_occurs(0)" name="Event"> Event Does Not Occur As it is now, nothing happens when clicking the radio buttons, but I'm also not getting any Javascript errors. After I get this working, I would also like to find some way to disable one of the handles through changing the slider property. Ie leave the handle where its at but not allow it to be dragged. Any help is greatly appreciated.

    Read the article

  • Slider with buttons. How to improve?

    - by Kalinin
    I need to make slider. I have content (which should shift horizontally) and two buttons - "right" and "left". If you press the button and hold it, the content starts to move (in the appropriate direction). If you not hold the button, then the movement stops. This behavior is copies the behavior of usual window scrollbar. I wrote code: var animateTime = 1, offsetStep = 5; //event handling for buttons "left", "right" $('.bttR, .bttL') .mousedown(function() { scrollContent.data('loop', true).loopingAnimation($(this)); }) .bind("mouseup mouseout", function(){ scrollContent.data('loop', false); }); $.fn.loopingAnimation = function(el){ if(this.data('loop') == true){ var leftOffsetStr; leftOffsetInt = parseInt(this.css('marginLeft').slice(0, -2)); if(el.attr('class') == 'bttR') leftOffsetStr = (leftOffsetInt - offsetStep).toString() + 'px'; else if(el.attr('class') == 'bttL') leftOffsetStr = (leftOffsetInt + offsetStep).toString() + 'px'; this.animate({marginLeft: leftOffsetStr}, animateTime, function(){ $(this).loopingAnimation(el); }) } return this; } But it does have a few things that I do not like: Always call the function animation (loopingAnimation) - I think that this is an extra load (not good). When moving content he "twitches and trembling" - (it's not pretty). How can I solve this problem more elegantly and without the drawbacks of my code?

    Read the article

  • Lock statement vs Monitor.Enter method.

    - by Vokinneberg
    I suppose it is an interesting code example. We have a class, let's call it Test with Finalize method. In Main method here is two code blocks where i am using lock statement and Monitor.Enter call. Also i have two instances of class Test here. The experiment is pretty simple - nulling Test variable within locking block and try to collect it manually with GC.Collect method call. So, to see the Finilaze call i am calling GC.WaitForPendingFinalizers method. Everything is very simple as you can see. By defenition of lock statement it's opens by compiler to try{...}finally{..} block with Minitor.Enter call inside of try block and Monitor.Exit in finally block. I've tryed to implement try-finally block manually. I've expected the same behaviour in both cases. in case of using lock and in case of unsing Monitor.Enter. But, surprize, surprize - it is different as you can see below. public class Test : IDisposable { private string name; public Test(string name) { this.name = name; } ~Test() { Console.WriteLine(string.Format("Finalizing class name {0}.", name)); } } class Program { static void Main(string[] args) { var test1 = new Test("Test1"); var test2 = new Test("Tesst2"); lock (test1) { test1 = null; Console.WriteLine("Manual collect 1."); GC.Collect(); GC.WaitForPendingFinalizers(); Console.WriteLine("Manual collect 2."); GC.Collect(); } var lockTaken = false; System.Threading.Monitor.Enter(test2, ref lockTaken); try { test2 = null; Console.WriteLine("Manual collect 3."); GC.Collect(); GC.WaitForPendingFinalizers(); Console.WriteLine("Manual collect 4."); GC.Collect(); } finally { System.Threading.Monitor.Exit(test2); } Console.ReadLine(); } } Output of this example is Manual collect 1. Manual collect 2. Manual collect 3. Finalizing class name Test2. Manual collect 4. And null reference exception in last finally block because test2 is null reference. I've was surprised and disasembly my code into IL. So, here is IL dump of Main method. .entrypoint .maxstack 2 .locals init ( [0] class ConsoleApplication2.Test test1, [1] class ConsoleApplication2.Test test2, [2] bool lockTaken, [3] bool <>s__LockTaken0, [4] class ConsoleApplication2.Test CS$2$0000, [5] bool CS$4$0001) L_0000: nop L_0001: ldstr "Test1" L_0006: newobj instance void ConsoleApplication2.Test::.ctor(string) L_000b: stloc.0 L_000c: ldstr "Tesst2" L_0011: newobj instance void ConsoleApplication2.Test::.ctor(string) L_0016: stloc.1 L_0017: ldc.i4.0 L_0018: stloc.3 L_0019: ldloc.0 L_001a: dup L_001b: stloc.s CS$2$0000 L_001d: ldloca.s <>s__LockTaken0 L_001f: call void [mscorlib]System.Threading.Monitor::Enter(object, bool&) L_0024: nop L_0025: nop L_0026: ldnull L_0027: stloc.0 L_0028: ldstr "Manual collect." L_002d: call void [mscorlib]System.Console::WriteLine(string) L_0032: nop L_0033: call void [mscorlib]System.GC::Collect() L_0038: nop L_0039: call void [mscorlib]System.GC::WaitForPendingFinalizers() L_003e: nop L_003f: ldstr "Manual collect." L_0044: call void [mscorlib]System.Console::WriteLine(string) L_0049: nop L_004a: call void [mscorlib]System.GC::Collect() L_004f: nop L_0050: nop L_0051: leave.s L_0066 L_0053: ldloc.3 L_0054: ldc.i4.0 L_0055: ceq L_0057: stloc.s CS$4$0001 L_0059: ldloc.s CS$4$0001 L_005b: brtrue.s L_0065 L_005d: ldloc.s CS$2$0000 L_005f: call void [mscorlib]System.Threading.Monitor::Exit(object) L_0064: nop L_0065: endfinally L_0066: nop L_0067: ldc.i4.0 L_0068: stloc.2 L_0069: ldloc.1 L_006a: ldloca.s lockTaken L_006c: call void [mscorlib]System.Threading.Monitor::Enter(object, bool&) L_0071: nop L_0072: nop L_0073: ldnull L_0074: stloc.1 L_0075: ldstr "Manual collect." L_007a: call void [mscorlib]System.Console::WriteLine(string) L_007f: nop L_0080: call void [mscorlib]System.GC::Collect() L_0085: nop L_0086: call void [mscorlib]System.GC::WaitForPendingFinalizers() L_008b: nop L_008c: ldstr "Manual collect." L_0091: call void [mscorlib]System.Console::WriteLine(string) L_0096: nop L_0097: call void [mscorlib]System.GC::Collect() L_009c: nop L_009d: nop L_009e: leave.s L_00aa L_00a0: nop L_00a1: ldloc.1 L_00a2: call void [mscorlib]System.Threading.Monitor::Exit(object) L_00a7: nop L_00a8: nop L_00a9: endfinally L_00aa: nop L_00ab: call string [mscorlib]System.Console::ReadLine() L_00b0: pop L_00b1: ret .try L_0019 to L_0053 finally handler L_0053 to L_0066 .try L_0072 to L_00a0 finally handler L_00a0 to L_00aa I does not see any difference between lock statement and Monitor.Enter call. So, why i steel have a reference to the instance of test1 in case of lock, and object is not collected by GC, but in case of using Monitor.Enter it is collected and finilized?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >