w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to hide first two elements of
with jQuery?
http://jsbin.com/uciyiv/1/edit <-- demo with multiple elements with same class .ShippingMethod $('.ShippingMethod').find('dt:lt(2), dd:lt(2)').hide(); http://api.jquery.com/lt-selector/ Select all elements at an index less than index within the matched set.

Categories : Jquery

How to hide all elements in a Layout in Android at once?
No need to hide views instead of that just use ViewFlipper concept. Just declare view flipper in your xml file with your two linearlayouts like this <Viewflipper android:id="@+id/myViewFlipper" android:layout_height="wrap_content" android:layout_width="match_parent"> <LinearLayout android:id="@+id/layout1" android:layout_height="wrap_content" android:layout_width="match_parent"></LinearLayout> <LinearLayout android:id="@+id/layout2" android:layout_height="wrap_content" android:layout_width="match_parent"></LinearLayout> </Viewflipper> And get viewflipper reference in your java code like this Viewflipper mFlipper = (Viewflipper)findViewById(R.id.myViewFlipper); use mFlipper.showNext(), use mFlipper.showPrevious() methods to hide and s

Categories : Android

Hide elements if its childNodes are empty
Try function getChildrenByClassName(el, className){ var children = []; for (var i = 0; i < el.childNodes.length; i++) { if (el.childNodes[i].className == className) { children.push(el.childNodes[i]); } } return children; } function addBtn() { var comments = document.querySelectorAll(".comments_list > .comment_item"), comment, combody; for (var i = 0; i < comments.length; i++) { comment = comments[i]; var replies = comment.querySelectorAll('.reply_comments .comment_body'); if(replies.length > 0){ combody = getChildrenByClassName(comment, 'comment_body')[0]; if(combody){ var btn = document.createElement("input"); btn.type = "button";

Categories : Javascript

CSS hide elements when they aren't in the parent
This will not work the way you want. Usually, to make sure a child element is contained visually by the parent, you need to set overflow:hidden; to the parent element. In your case you use height:0; width:0; for your parent and you just have borders to depict your element... no dice with that one AFAIK, cause setting overflow to hidden on an 0x0 px parent - will not make visible your child elements.

Categories : Jquery

hide Html elements by using javascript
var divOne = document.getElementById('1'); divOne.style.visibility = 'hidden'; document.getElementById on MDN

Categories : Javascript

infinite scroll hide first elements
Try this css on your elements: .yourelement:nth-child(-n+50){ display:none; } I think you can set the .yourelement name in the itemSelector property of the plugin.

Categories : Javascript

hide html elements but keep them part of isotope
one obvious way to get around this is do a parent div that holds both divs that I want to toggle between instead of <div></div> <div></div> do <div> <div></div> <div></div> </div> than attach the isotope to the parent container. no need to change style except for the margin portion if you want them to be appear over the other space

Categories : Jquery

simple show and hide elements with parent next
Try $('.wp-post-image').click(function(){ var $next = $(this).closest('.switchswitch').removeClass('selected').closest('.collections').next().find('.switchswitch') if ($next.length) { $next.addClass('selected'); } else { $(".switchswitch:first").addClass('selected'); } });

Categories : Jquery

Show/Hide elements based on the ID of both targets
Use relative selectors, so you can do away with IDs. $(".show").change(function(){ if ($(this).val() == "1" ) { $(this).next('div').slideDown("fast"); } ...etc... }

Categories : Javascript

How can I hide the display of a page until the ng-include elements are available?
The ng-include directive raises an $includeContentLoaded event. You could use that to set a value which in turn controls a ng-show directive placed on the block-border element. https://github.com/angular/angular.js/blob/master/src/ng/directive/ngInclude.js#L178

Categories : Angularjs

Hide
You Can use jScroll in J Query. Its actually a plug-in for lazy loading. At first it only loads the front view. ie the content that you can see at first and as you scroll down the rest of the content is loaded. Look Here for the plugin.

Categories : HTML

How to reliably hide elements when using JQueryUI Sortable?
You could use the cursorAt option, it seems to help quite a bit. Working Example $(document).ready(function () { $('.handle').mousedown(function() { $('.stuff-to-hide').hide(); }); $("#SortParent").sortable({ cursorAt: {top:25, left:15}, //Important bit handle: '.handle', items: '.sort-child', start: function(event, ui) { $('.stuff-to-hide').hide(); $('.sort-child').addClass('diff-height'); }, helper: function() { return '<p>MY DRAGGING BAR</p>'; }, forceHelperHeight: true, stop: function() { $('.stuff-to-hide').show(); $('.sort-child').removeClass('diff-height'); } }); }); Or you could consider using some sort of sortable accordion like

Categories : Jquery

How to show hide elements using spring security
Make sure you have included the Spring Security Tag Library in the JSP: <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> In your security configuration include: <beans:bean class="org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler"/> Then use the authorize tag: <sec:authorize access="isAuthenticated()"> <!-- Content for Authenticated users --> </sec:authorize> <sec:authorize access="isAnonymous()"> <!-- Content for Unauthenticated users --> </sec:authorize>

Categories : Spring

Display/hide elements using location.hash
Corections in the posted code aside, you need to call your toggle function when the page is loaded as well. As you're using jQuery, add this at the bottom of your script tag: $(document).ready(function() { toggle(); }); Like so: function toggle() { var i = 0, divs = document.getElementsByTagName("div"), hash = window.location.hash.substring(1); //extracts hash without # for (i; i < divs.length ; i++) { if (divs[i].id === hash) { $(divs[i]).css("display", "block"); } else { $(divs[i]).css("display", "none"); } } } window.onhashchange = toggle; // triggers on first load of page $(document).ready(function() { toggle(); });

Categories : Javascript

svg elements reset on hide/show in chrome
Yes, this is a "feature" of Chrome. "display: none" (including css way) completely ruins all interactions with SVG. Use size or position instead: jQuery.fn.weirdHide = function() { $(this).css("width", 0) .css("height", 0) .css("position", "absolute") .css("left", "-9999px"); } jQuery.fn.weirdShow = function() { $(this).css("width", "") .css("height", "") .css("position", "") .css("left", ""); } $("#map").weirdHide(); $("#map").weirdShow();

Categories : Javascript

elements hide with jquery issue in chrome
Probably you used jquery .hide() and .show() methods. These are working in firefox perfectly but in chrome some space left below the hidden divs. You can use these methods to hide and show for the chrome issue; $('#cat-head').css('display', 'none'); $('#cat-head').css('display', 'block'); this solved my problem. Hope it helps.

Categories : Javascript

hide message elements if value =default... in jquery
If your first option has an empty value: if( $('select#Filter').find('option:selected').val().length===0 ){ /* ... */ } Or if you want to test on text (which is a bit slower, but hardly noticable:) if( $('select#Filter').find('option:selected').text()=='SELECT' ){ /* ... */ }

Categories : Jquery

Wordpress 3.6: Mediaelement (audio) hide elements
To hide everything except the play and pause button try: CSS .mejs-time, .mejs-time-rail, .mejs-volume-button, .mejs-mute, .mejs-horizontal-volume-slider { display: none !important; } .mejs-container { width: 26px !important; } Because of 26px maybe text is not shown properly. Move it outside maybe useful in your case. [audio mp3="audio_path"][/audio] I am a very important message

Categories : CSS

How do i hide parent elements if child does not exist
You can do $('.optionfield').each(function(){ if($(this).find('span.required').length == 0){ $(this).hide(); } }); Proof is in the fiddle ;)

Categories : Jquery

HIde form elements when page initially loads
Give class attribute to all element. Eg: if you have a input element like <input type="text" name="something" id="something" class="hideme" /> hide element by using same class name for all elements as I explained above $(document).ready(function() { $(".hideme").hide(); });

Categories : Javascript

Show or hide jQuery elements according to boolean array
You can use .toggle() - assuming obj is a jQuery wrapper containing a set of targeted elements in the same order as in the data array success: function(data) { obj.each(function(idx, el){ $(this).toggle(data[idx]) }) }

Categories : Javascript

jquery Hide and show elements with add remove class
I think this is what you need (when a .child-list opens, the other that are open will close): Demo here var $selexcta = jQuery.noConflict(); $selexcta('.events-category').change(function () { console.log('showing sub categories'); var c = this; if (c.checked) { $selexcta('.events-category').each(function() { if (this != c) { this.checked =false; $selexcta('.child-list li input').prop('checked',false); $selexcta('.child-list').removeClass("mm") } }); $selexcta('.child-list').each(function () { if (this.style.display != 'none' && this != $selexcta(this).next('.child-list')) { $selexcta(this).slideToggle('fast'); } }); $selexcta(this).next('.child-list').slideToggle('fast'); $selex

Categories : Jquery

Working JS/Jquery with SVG to show/hide elements within the SVG
I think the problem is that floor1, floor2, and floor3 are defined inside your anonymous callback function scope thus they are out of scope for showFloor1(). Try to define them after you define var a = as empty arrays, then add to arrays in your callback for addEventListener.

Categories : Javascript

Hide some elements in a html node depending on content
DEMO var searchValue = 500; $('.parent').find('.class3').show().filter(function () { return +$.trim($(this).text()) !== searchValue // or '<' or '>' }).hide(); BTW, you have a typo here: <div classe="parent" > Must be: <div class="parent" >

Categories : Jquery

jQuery show/hide for multiple elements without specific classes / id's
You can find the box-content element in relation to the clicked open-close element. From the given markup, it is the next element of the clicked element $(document).ready(function(){ $(".box-content").hide(); $(".open-close").click(function () { //as @insertusernamehere said the selector ".box-content" is not required //$(this).next(".box-content").slideToggle("slow"); $(this).next().slideToggle("slow"); }); }); Demo: Fiddle

Categories : Javascript

Javascript hide child nodes of a object elements data value
You can do this with an iframe as long as you don't run afoul of same origin issue. The key is to access the contentDocument property of the iframe element (works on Chrome - for cross browser see: iframe.contentDocument Not Working in IE8 and ... For example - this page: <html> <head> </head> <body> <iframe id='siteconfigwindow' src=''></iframe> <script> document.getElementById("siteconfigwindow").src = 'test.html'; document.getElementById("siteconfigwindow").addEventListener('load', function() { this.contentDocument.getElementById("nodeAdd").parentNode.style.visibility = 'hidden' }); </script> </body> </html> Successfully loads and hides the button group you've described above: <html> <hea

Categories : Javascript

How to hide the form elements if the field is empty in ruby on rails?
So if I got it right what you want to do is not to render the form if what you received with the param product_type_id is blank. Is it possible for you to instatiate the variable in the controller instead of defining it directly in the form builder? For instance in your controller: def index @product_type = OpenStruct.new(params[:f]) end and in your view: <% unless @product_type.product_type_id.blank? %> <div class="field"> <%= render 'form', product_type: @product_type %> </div> <% else %> <p>Select Product Type</p> <% end %> and finally your partial: <%= form_for(product_type), as: :f, url: product_types_path, method: :get, remote: true, html: {class: 'type'}) do |f| %> <div class="field"> <%=

Categories : Ruby On Rails

Show/hide multiple elements with JQUERY/HTML when hovering
If I understand you correctly, you want to show a different when you mouse over the 'off' variation. And when you leave the 'Over' variation you want to show the original. This can be accomplished with this jQuery: $(document).ready(function () { $("div.sidenavOff").mouseover(function () { $(this).siblings(".sidenavOver").show(); $(this).hide(); }) $("div.sidenavOver").mouseout(function () { $(this).siblings(".sidenavOff").show(); $(this).hide(); }); });

Categories : Javascript

Show/hide multiple elements on hover with JQuery and HTML
This is my jquery code [...]. I don't quite understand it $(document).ready(function () {/* function body */}); When document (as a jQuery object $) is ready, invoke a function as described by /* function body */ $("div.sidenavOff") Use jQuery $ to get all HTMLElements that match the CSS Selector div.sidenavOff .mouseover(function () { $(this).removeClass().addClass("sidenavOver"); }) When the mouse goes over one of these elements (mouseover), remove the class undefined (as nothing between brackets, removeClass), then add the class sidenavOver (addClass) to the element that the mouse is over (this). class here can be understood as meaning the same as the HTML attribute class; <a class="xyz"> .mouseout(function () { $(this).removeClass().addClass("sidenavOff"); }

Categories : Javascript

Jquery - show/hide on hover events for two elements conflict
The problem is that there is a 1px gap between the menu item and your .box element. Set top: 37px and it should work Edit: You have to wrap the submenu and the menu item and listen to the hover event of the wrapper: http://jsfiddle.net/Sx9J2/7/

Categories : Jquery

jQuery select option show / hide for multiple elements
See this demo $(document).ready(function (e) { var $targets = $(".open_times"); $(".pr_opener").change(function () { var i = $('option:selected', this).text(); if (i=='Open') { $(this).closest("li").next(".open_times").show(); } else { $(this).closest("li").next(".open_times").hide(); } }); });

Categories : Jquery

jQuery UI leaving trash elements behind after .hide('blind').remove()
Your .hide() call has not finished in time for your .remove() call. You need to supply a callback to the .hide() method, like so: $('target-elem').hide('blind', function () { $(this).remove(); }); For more information, please see http://api.jqueryui.com/hide/

Categories : Jquery

JQuery - how to remember show/hide elements when navigating back from another page of a form
You have two choices here Use a server side technology like database to remember the previous status Use a client side technology In client side there are two ways you can do it Cookie Use cookie to store the value(a state value like hide/show a particular element), since you are using jQuery you can use a cookie library like this one webstorage If you are supporting only modern browsers(html5), then you can think about webstorage like session storage

Categories : Jquery

JQuery .hide function works okay with text fields but assigns a particular value to select box elements
Is there a "blank" value in your select box? If not, try this: <select id="mySelect"> <option value="">Please select an option</option> </select> Fiddle

Categories : Jquery

jQuery Hide and show elements with add remove class not working after applying uniform.js
Yes, previously, your checkbox and your UL were siblings, so .next() worked. Now, however your checkbox is wrapped up and further down in the tree. So this: $selexcta(this).next('.child-list')... won't find the next ul. I might be missing something, but I'd suggest not using .next() to traverse the tree. Rather, when a checkbox is clicked, deselect all checked check boxes. Then go 'up' the tree from the checkbox to the nearest li using $(this).closest('li') Then down one to the nearest ul $(this).closest('li').find('ul') then you can make that visible: $(this).closest('li').find('ul').slideToggle('fast').addClass('mm'); You should be able to get away without using the .method() function at all. Hope that helps.

Categories : Javascript

Jquery / Show/Hide / ToggleClass - Click behaviour on dynamically added elements
Try $(document).on("click",'.instructions', function(event,ele){ $(this).next('div').toggleClass("limited"); var currMessage = (ele.text() == hideMessage) ? showMessage : hideMessage; ele.text(currMessage); });

Categories : Jquery

How would I remove a DIV if there are no IDs using Greasemonkey?
We might need to see the whole page to work out robust selectors for those <div>s. But, if they always contain iframes with src attributes to undesirable content, then you can use those iframes to hunt down the dastardly divs. Make a list of key text snippets in the bad iframe src attributes. I'm also using jQuery and waitForKeyElements(), in case this content is added by AJAX. So, the script looks something like this: // ==UserScript== // @name _Remove bad divs containing bad iframes // @include http://YOUR_SERVER.COM/YOUR_PATH/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @require https://gist.github.com/raw/2625891/waitForKeyElements.js // @grant GM_addStyle // ==/UserScript== /*- The @grant directive is needed to work around a de

Categories : Javascript

How to change var value in greasemonkey
If I understand you correctly, this should be an easy fix. You can simply overwrite the variable: So replace myInfo { "plusActive":true; } with plusActive = true; You shouldn't need to run any sort of a function, assuming the variable in question is not read until the page is loaded (which is far from certain).

Categories : Misc

How to set the swf path of TableTools when using it with Greasemonkey
If one examines the source code of dataTables.Tabletools.js, while initializing a datatable, tabletools uses the TableTools.DEFAULTS objects and combines them with your tables custom settings. At line no 1158 , as per the version (1.0.4-Tabletools2) that i have, the code sets the moviePath for ZeroClipboard_TableTools, which i am assuming, is a singleton. Now if you have multiple tables on the page, this object ends up taking the value of swfpath specified for the last table , or Default "sSwfPath": "../swf/copy_csv_xls_pdf.swf" , if not specified. /* Flash file location */ this.s.swfPath = this.s.custom.sSwfPath; if ( typeof ZeroClipboard_TableTools != 'undefined' ) { ZeroClipboard_TableTools.moviePath = this.s.swfPath; } So, i c

Categories : Misc

greasemonkey currency converter
You need to recurse or loop through just the nodes that have the dollar values. Never use replace() or RegExp on .html() or innerHTML. Not only will this trash the target page, but you will have a devil of a time getting the desired results. Recurse through the page using DOM methods. Note that currency values come in many formats, so converting them can get complex. Here's moderately robust code for the whole page (sans iframes) You can see it in action at jsFiddle: // ==UserScript== // @name _Global currency converter, dollars to rupees // @include http://YOUR_SERVER.COM/YOUR_PATH/* // @grant GM_xmlhttpRequest // ==/UserScript== GM_xmlhttpRequest ( { method: "GET", url: 'http://rate-exchange.appspot.com/currency?from=USD&to=INR', //Google sends m

Categories : Javascript



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