w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
jquery fadeToggle not working on echoed script
You have both the hash and the dot in your PHP-generated selector: <?php echo '#'.$postid.'.image'; ?> produces a string like #mypostid.image I don't know your HTML structure, but you may want the selector to be #mypostid .image (note the space), so: <?php echo '#'.$postid.' .image'; ?>

Categories : PHP

HTML box moves when using JQuery statements hide/fadetoggle
In my experience it's better to transition a wrapper div than a form itself. Try this: <div id="contact-form-wrapper" style="display: none;"> <form id="contact-form" action="/" method="post"> ... </form> </div> $("#dd").on('click', function() { $('#contact-form-wrapper').fadeToggle(750); });

Categories : Jquery

jQuery fadeToggle + mouseout combination, prevent toggled content triggering an event
No need to use the mouseout handler; the hover function will take care of that for you with a second callback. You can use next to get the relevant .content div. $('.corner').hover(function() { $(this).addClass("corner-full").next().fadeToggle(); }, function() { $(this).removeClass("corner-full").next().fadeToggle(); }); Working Fiddle api.jquery.com/hover/

Categories : Jquery

Having children of an element animate separately but in order
Fiddle This should do the job. function anim($child) { //look for the next sibling var $next = $child.next('.childrenDiv'); $child.animate({ 'top':'+=10px' }, function() { //if there was a next child, then animate it if ($next.length > 0) anim($next); }); } //start the animation with the first .childrenDiv child of #fatherDiv anim($('#fatherDiv .childrenDiv:first-child')); We just declare a little method called anim that uses a recurring callback to select the next .childrenDiv if one is available and animates it. We call it using the first child of #fatherDiv. This is just basic recursion, the base case being if there is no next sibling to animate.

Categories : Javascript

Changing background-color from separately elements from an array (jquery)
you can name your variable then concat it into your selector since its a string not a JQ object. var class = getPieceName(board[i][j][0]) $('.' + class).click(function() {

Categories : Jquery

Arrange nodes under a closed element - XSLT
To do this you need to you will need a compound key, which will be a concatenation of all values that identify your group, in your case the Type (of the parent element), and the Position <xsl:key name="streetByPosition" match="Street" use="concat(../Type, '|', Position)" /> You can then use the key in the normal way key('streetByPosition', concat(../Type, '|', Position)) Try the following XSLT: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:strip-space elements="*" /> <xsl:output method="xml" indent="yes" /> <xsl:key name="streetByPosition" match="Street" use="concat(../Type, '|', Position)" /> <xsl:template match="@*|node()"> <xsl:copy><xsl:apply-templates select="@*|node()" /></x

Categories : Xml

Close div by clicking outside using fadeToggle
Attach an event handler to the click event on the document. When a click occurs check the target to determine if either the .dropdown-menu or .menu-nav was clicked. If not, then hide the menu. var dropDown = jQuery('.dropdown-menu'); jQuery('.menu-nav').click( function (e) { dropDown.fadeToggle('fast'); e.preventDefault(); } ); jQuery('div:not(.menu-nav, .dropdown-menu)').click( function (e) { dropDown.fadeOut('fast'); e.preventDefault(); } ); $(document).on("click", function(e){ var $target = $(e.target); if(!$target.is(".menu-nav") && !$target.is(".dropdown-menu")){ dropDown.fadeOut('fast'); } }); Working Example: http://jsfiddle.net/UJNd5/

Categories : Jquery

fadeToggle all elements one at a time
.delay(n) sets a timer to delay execution of functions in the queue (for a single statement), not between multiple statements. That is why they all come in at the same time. To do what you want, you could vary the delay time associated with each paragraph like this: var i = 0; while (i<=2) { myfade(i); i++; } function myfade(i) { var p = $("p"); ($(p[i]).delay(i*1000).slideToggle(2000)); } Here's an example that demonstrates the effect you want, and how delay works and why you were getting your original results. http://jsfiddle.net/RvK35/1/

Categories : Jquery

Make fadetoggle fade in
http://jsfiddle.net/nyWzK/ Change your JS to look like this $('.expand').click(function () { $(this).next().fadeToggle("slow"); }); THEN Change <tr style="visibility: hidden;"> in your css to <tr style="display:none;"> if you want to stick with the whole visibility thing then you'll have to explore jquery's animate function combined with css opacity - HOWEVER, I would recommend against this as its extra effort you don't really need. http://api.jquery.com/animate/ http://www.w3schools.com/css/css_image_transparency.asp

Categories : Javascript

fadeToggle and toggle z-index on div
i assume calling the toggleZindex() function inside the callback function of fadeToggle() should work ..to make sure fade animation completes.. $(document).on('click', '.button', function() { var id = $(this).data('target'); $('.' + id).fadeToggle("fast", "linear",function(){ $(thjs).toggleZindex(); }); });

Categories : Jquery

JQuery- append element's current html to element's new child element
Just wrap the contents of your 'videoInfo' DIV with the 'videoInfoInner' DIV you've created and stick the new 'videoInfoShadow' DIV in front of it: var videoInfo = $('.videoInfo'); videoInfo.wrapInner($(document.createElement('div')).addClass('videoInfoInner')); videoInfo.prepend($(document.createElement('div')).addClass('videoInfoShadow')); Demo

Categories : Javascript

Finalizing a Cursor that has not been deactivated or closed or database not closed error
When you are done with the cursor, you need to call Cursor.close(). Leaving it not closed leads to memory leaks. E.g.: Cursor cursor = null; try { cursor = getContentResolver().query(myUri, MY_PROJECTION, null, null, null); if (cursor != null && cursor.moveToFirst()) { // moar code } } finally { if (cursor != null) { cursor.close(); } }

Categories : Android

jQuery toggle closed other elements
You could try this: $('h3[id^="dd_featprod"]').click(function(){ var id = $(this).attr('id'); var theProd = id.split("+")[1]; var thelist = ".dd_fp" + theProd; $('ol').not(thelist).hide(500); $(thelist).toggle(500); }); When you click an element, initally will close that element (because is opened) and every other element. Next time you click an element will open that element and close the rest. DEMO: jsFiddle

Categories : Jquery

How to add action when jQuery Mobile dialog closed
The dialog widget is essentially just the page widget styled to look like a dialog so the normal page events will still fire. Based on your question it sounds like the pagehide should do what you want, here's a link to some of the other page events For example HTML <div data-role="page"> <div data-role="header"><h3>First Page</h3></div> <div data-role="content"> <a href="#myDialog" data-rel="dialog" >Open Dialog</a> </div> <div data-role="footer"><h3>Footer</h3></div> </div> <div data-role="page" id="myDialog"> <div data-role="header"><h3>A Dialog</h3></div> <div data-role="content"> <p>A Dialog</p> </div>

Categories : Jquery

JQuery layout fixed width when closed
I think the problem is that closed means closed and gone, and so you're not supposed to still be able to see the frame. If I understand what you want to do correctly you can fake it by overriding the close action with custom code. This involves overriding the onclose_start callback, setting the size, then returning false to prevent the pane closing. Note this means that as far as the system is concerned the pane isn't really closed. The code below does all of that, it makes a new variable on the west pane state object to store the old size. It defines that at the start of the creation function (although the system doesn't complain if it's not defined). You could also use a global variable or some other storage. You could make the function more generic to not just work for west, etc.

Categories : Jquery

How to detect that JQuery-Mobile dialog was closed
I figured out a quirky way to achieve what I want: $(document).on( "dialogcreate", function( event, ui ) { $(document).one('pagechange', function (e, f) { $(document).one('pagechange', function (e, f) { console.log('Settings closed'); }); }); }); Explanation: When the dialog is created the dialogcreate event is thrown I then register for one pagechange event, which is thrown when jquery-mobile opens a dialog. So now the dialog is open Now I register for another single pagechange event which will be thrown when the dialog closed and I am back in the original location. Please note that this won't work if the settings dialog triggers another pagechange event before it will finally be dismissed. However, this works in my case. I hope there is a cleane

Categories : Javascript

Stop YouTube video when div is closed with jQuery
As you're using iFrame, you can just clear its src: $( document ).ready(function() { $("#close_box1").on("click", function () { $(".full_page_overlay1").fadeOut(); $(".cart_over1").fadeOut().find("iframe").attr("src", ""); }) }); If you're using the jQuery UI Dialog, you could set this to be done on the close event.

Categories : Jquery

Jquery: masonry('hide',element) method with a jquery element
If you read the documentation then you find items are the array of elements. items Type: Array of Masonry.Items Try this, var arr=new Array(); arr.push($(this)); $container.masonry('hide', arr);

Categories : Jquery

jQuery mobile - allow scrolling only when side panel is closed?
The latest jQuery Mobile API docs say to use $( ".selector" ).on( "panelopen", function( event, ui ) {} ); Could you try that? It may work using the on() method instead of the older bind() approach. Also, perhaps you could bind the overlflow change to a child of body instead of the body element. Its hard to give a more specific solution without seeing more of your code. http://api.jquerymobile.com/panel/#event-open UPDATE Here is a link to the jsbin with working solution: http://jsbin.com/azavup/2/ The exact JS used is below: $( document ).on( "pageinit", "#page1", function( event ) { $( "#defaultpanel" ).on( "panelopen", function( event, ui ) { //console.log("i am open"); $('body').css("overflow", "hidden"); } ); $( "#defaultpanel" ).on( "panelclose", function(

Categories : Android

JQuery Mobile - event that is called when a select box is closed
Use pagehide event, as dialog accepts same events of page in jQuery Mobile Demo $(document).on('pagehide', '[data-role=dialog]', function () { // Your code here });

Categories : Jquery

jQuery UI layout closed panel renumbers iframes
For future reference, the answer is here. Use, e.g.: <a href="#p2" title="to page 2" onclick="window.open('iframepage2.html#p2', 'page1ID'); return true;">▽</a>

Categories : Javascript

how to clean the data when the popup window is closed in jquery
You can do $('#popup_box').empty(); to empty the div. if you want to do it after fade animation is over then: $('#popup_box').fadeOut("slow", function(){ $(this).empty(); });

Categories : Javascript

Application gets closed when terminal is closed, how to stop this?
Use nohup to prevent child processes from being killed when the terminal closes. spawn nohup /usr/bin/firefox https://www.google.com/ I assume there's more to the script, since there's no need to use Expect just to start firefox.

Categories : Python

jQuery menu open after page load, should start out closed
$('.hidden').slideUp(1).delay(2000).slideDown('slow'); This is just a prototype integrate with your code .. JSFIDDLE DEMO

Categories : Javascript

jQuery UI Tabs - Default Closed? How to make Collapsed on page load?
This could use some polish, but it should get you on the right track. http://jsfiddle.net/vbmMJ/2/ <html> <head> <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"/> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <script type="text/javascript"> $(function() { $("#tabs").tabs(); $(".tab-content").hide(); $(".ui-tabs-active").removeClass("ui-tabs-active"); $(".ui-state-active").removeClass("ui-state-active"); $(".ui-tabs-anchor").click(function() { $($(this).attr("href") + " .tab-content").first().show(); }); }); </script> </head>

Categories : Jquery

How to draw closed spline 3D (closed curve 3d) through unordered list of points3D. How to arrange points3D?
It sounds like you're looking for the Concave Hull of the data set. Unfortunately, I don't know of any pre-canned algorithms, but the link references a paper that another developer was starting from, as well as some sample code, so maybe that'll help you in the right direction.

Categories : C#

Is it possible to use a jQuery hook on an HTML element to trigger a click on a flash element?
If anyone else was wondering, I solved this with http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/

Categories : Javascript

How to fetch container element based on class name and outer element's ID using jquery
You can use the class-selector to find out an element with the specified class $("#rowForcustomfield_11300 .name")

Categories : Jquery

Removing element by EQ filtering doesn't remove the element from jQuery Object
Why the jQuery keeps the element in the group of the matched elements? In case you want to do something with it after removing it. remove removes the element from the DOM, but you may well want to do something further (like adding it elsewhere in the DOM or retrieving information from it). You can remove it from the set using slice or not (or more accurately: You can get a new object with all the same elements except the ones omitted by slice/not): previewItems.eq(index).remove(); previewItems = previewItems.not(previewItems[index]);

Categories : Jquery

Jquery Scrolling Element to Position of Newly Appended Element (Calculating relative offset to parent)
change to: ul.stop().animate({ scrollLeft: li.position().left + ul.scrollLeft() }, 2000); You are looking for position() method, which returns relative position, instead of offset, which returns absolute (more proper - relative to the document) position, and add current scroll state (which affects the position reading)

Categories : Javascript

How to select an element with a specific id from a directive's linking function's 'element' parameter, using jQuery rather than angular's jqLite?
In jQuery you can optionally set the root from where it start looking. $(selector[, root]) In your case it would be $("#lr", element) Also it is worth noting that there should only be one element with a particular ID on the page at any given time, so $("#lr") should also work.

Categories : Javascript

Finding the last visible li element within overflow:hidden element (jquery)
You can't directly query for elements that are overflowing as they are not hidden as far as the DOM is concerned (and there are no attribute changes to check for with JQuery). You will need to check positions instead against the width/height of the menu. JSFiddle here: http://jsfiddle.net/TrueBlueAussie/WFGJ4/ menu.find('li').each(function () { totalWidth += $(this).outerWidth(); if (totalWidth > menuWidth) { $(this).before("<li><a>More</a></li>"); return false; // Abort loop } }); I put auto scrolling on the menu so you can actually see what is overflowed.

Categories : Jquery

Change element property based on placement of another element - jQuery
You can use .has() method or :has selector: $('p').has('cite').next('h1').css({'padding-top': 'value'}); Assuming all next h1 siblings of the selected p should be selected: $('p').has('cite').nextAll('h1').css({'padding-top': 'value'});

Categories : Jquery

The clicked html element is not equal to same element in jQuery $.each() loop
The jQuery function ($) returns a new Object (commonly referred to as a "jQuery object"), which represents a collection of DOM elements (as well as some properties and methods to manipulate the collection). Even if the same elements are selected (same or different selectors, even), meaning the jQuery objects contain the same DOM elment(s), they still wouldn't be equal. JS objects are never == (or ===) unless they actually refer to the same object. For example, $("#element_id") === $("#element_id") is false even though they are selecting the same element. But var el = $("#element_id"), ref = el; alert(el === ref); would alert true because they both refer to the same object. If you want to compare these elements, compare references to DOM elements, like this: $('#first').on('click', func

Categories : Javascript

jQuery scroll down to new dynamic element, then slideDown to see the effect of new element
did you try this: $('html, body').animate({ scrollTop: $("#copyright").offset().top }, 500, function(){ $("<%= j(render 'shop') %>").hide().appendTo($("#shops")).slideDown("fast"); });

Categories : Javascript

Traversing to the element closest to the element clicked jquery
since jquery is tagged... using jquery $('.toggle-advanced').click(function(){ $(this).parents('ul.normal').siblings('ul.advanced').toggle(); }); or $('.toggle-advanced').click(function(){ $(this).parents('.grp').find('ul.advanced').toggle(); }); these should work unless you aree adding the content dynamically.. use on() if added dynamically $('.normal').on('click', '.toggle-advanced', function(){ $(this).parents('.grp').find('ul.advanced').toggle(); });

Categories : Javascript

jQuery - need to toggle one element when hovering another element
You need to change your selector to select only one element with the class pshow. You can do that like this: <script type="text/javascript"> $(document).ready(function () { $('.hover').mouseenter(function() { $(this).closest('div').find('img.pshow').toggle(); }); }); </script>

Categories : Jquery

jQuery - find the most inner element of the container element
The best way: function innerMost( root ) { var $children = $( root ).children(); while ( true ) { var $temp = $children.children(); if($temp.length > 0) $children = $temp; else return $children; } } var $inner = innerMost($('.container')); My original solution that works with your markup, but not any: $('.container').find(':not(:has(*))');

Categories : Jquery

How to add the height of one element to the top margin of another element using JQuery
I got it. I used an iteration of ilya's idea. I added a container around everything that wasn't the nav and added top padding that was the height of the nav. I of course accomplished this through jQuery: $("#container").css("padding-top", $("#main").outerHeight() + "px" ); It works wonderfully. Thank you!

Categories : Jquery

Find element without class or id within element - jQuery
$('img[src="http://something.com"]').closest('span'); If you want to target only the specific span that holds image with a particular src then , you can use the above selector. But if you want to target All the td.box with span's as their descendent then the suggestion by @adeneo should work.

Categories : Jquery



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.