Skip to content
Advertisement

Tag: jquery

Toggle visibility property of div

I have an HTML 5 video in a div. I then have a custom play button – that works fine. And I have the video’s visibility set to hidden on load and visible when the play button is clicked, how do I return it to hidden when the play button is clicked again? I’m basically just trying to toggle it

Prevent click event after drag in jQuery

I have a draggable <div> with a click event and without any event for drag, but after I drag <div> the click event is apply to <div>. How can prevent of click event after drag? http://jsfiddle.net/prince4prodigy/aG72R/ Answer I made a solution with data and setTimeout. Maybe better than helper classes. and Check the fiddle.

Find and update in nested json object

I used this code to find the required portion from the json object from sJhonny’s Question Data Sample Function to find Use like so: This code is to select matching piece from the source. But what I want is to update the source object with new value and retrieve the updated source object. I want something like My code This

Bootstrap tab activation with JQuery

I have the following code: And the following script: In this case when the page is ready, the second tab will be activated but I always get a JavaScript error in the line $(‘.tab-pane a[href=”#’ + tab + ‘”]’).tab(); Can anyone help me, please? Answer Applying a selector from the .nav-tabs seems to be working: See this demo. I would

Appending a DOM element twice (jQuery)

Can someone explain why the following snippet does not add <foo> to both #a and #b? HTML: JS: jsfiddle Edit: thanks for the helpful points, the fact that .append() moves the element explains this behavior. Since the element in my application is actually a Backbone View’s .el, I prefer not to clone it. Answer Because using append actually moves the

Having trouble getting bound events to fire

I have included the below code in the header of my page: I have tested it by putting my mouse into the text field with this ID and removing it, clicking outside of it but nothing fires. I checked the error console and there is nothing, so it looks like it’s not even attempting to fire it. http://jsfiddle.net/kRaJy/ What am

How to format date with hours, minutes and seconds when using jQuery UI Datepicker?

Is it possible to format a date with jQuery UI Datepicker as to show hours, minutes and seconds? This is my current mockup: When I call .datepicker({ dateFormat: ‘yyy-dd-mm HH:MM:ss’ }) the returned value is: 201313-07-03 HH:July:ss Here is a JSFiddle. Answer For the time picker, you should add timepicker to Datepicker, and it would be formatted with one equivalent

Advertisement