show-hide

Displaying or hiding multiple fields based on selection dropdown - jquery

倾然丶 夕夏残阳落幕 提交于 2019-12-13 17:19:15
问题 I have a form containing a dropdown. Depending on the selection made in the dropdown, multiple fields should appear or hide. The jquery function, I have written, works only for one fields. If I select no in the dropdown only the title what is hidden the rest stays. I don't quite understand why. I could solve this by giving each field id another name (for example showing1, showing2, ...) and refer to this id in the function but that is a lot of repetition. Shouldn't there be a better way? Link

Hide registration and login buttons when a user logged in? [closed]

为君一笑 提交于 2019-12-13 09:56:16
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . oK, since my original question didn't make sense to the majority, I will explain in details. I have a membership system I made through some tutorials based on codeigniter framework. on my main page I have 3

jquery multiple show/hide buttons

巧了我就是萌 提交于 2019-12-13 07:26:12
问题 I am trying to convert a lot of JavaScript to jQuery and I have a task that I believe has a simple jQuery shortcut, but I don't know what it is and I haven't been able to find an example. I have a page with many toggled divs. They are in the form that follows where ### is a unique integer for each pair. <button class='togglebutton' onclick="toggle('div###');">+</button> <div id='div###'>...some text...</div> I'd assume the shortcut is something like: $('.togglebutton').onclick(function() {

Hide and show a div depending on session

瘦欲@ 提交于 2019-12-13 05:28:56
问题 I have an admin link with a div id "admin". Sessions are started when a user is logged in to show if it is a normal user or an admin. Normal users can't access the files for admin, but can still see the admin link. Is there a way to make it so normal users can't see the link, using only php or html , without jquery or jscript or any of those. 回答1: Using interleaved PHP & HTML with standard PHP syntax: <?php if ($user_is_an_admin) { ?> <div id='admin'> Only admins can see this... </div> <?php

Show Hide select options based on previous selection dropdown

佐手、 提交于 2019-12-13 04:19:41
问题 Thanks for reading my question... ;-) I'm building a Wordpress site that uses Custom Posts and Custom Fields to show a vehicle inventory. I would like the visitor to be able to filter the posts by Taxonomies... The plugin I use for drilling the available Taxonomies (Query Multiple Taxonomies) outputs all options it can find for that particular Taxonomy into a dropdown list. To prevent the dropdown list (i.e. Model) to become too long, I would like to show only those options that are based on

A script that tells something to disappaer once I click outside of it on anything

為{幸葍}努か 提交于 2019-12-13 03:44:28
问题 Okay I have a form search on my site that when clicked loads the search results into a hidden iframe that shows. This is the iframe: <iframe class="slidingDiv" id="frame-content-left2" name="search-box" src="content.html"></iframe> This is the button that toggles it show state on/off: <input type="submit" value="Search" class="send-button" /> Now when the above iframe shows the div with page content that the site's navigation links load into disappears. This is the div: <div id="myDiv">some

Hide/Show all objects in a NSWindow - Cocoa

杀马特。学长 韩版系。学妹 提交于 2019-12-13 02:49:14
问题 Quick question. How can I hide and then show all the objects in a NSWindow without doing something terribly tedious and complicated? Kevin 回答1: I may be late to this particular party, but how about this? [[window contentView] setHidden:YES]; And conversely... [[window contentView] setHidden:NO]; That's certainly less tedious and complicated. :D 回答2: for(NSView* view in [[window contentView] subviews]) { [view setHidden:YES]; } 回答3: Assuming everything is a NSView: //Hide views for (NSView

Jquery- Hide/Show a div after a duration on page load

我与影子孤独终老i 提交于 2019-12-13 02:26:18
问题 I have a div which will display after some time .i.e on page load it will be invisible and after some duration it will be visible. I tried this, but its not working for me. setTimeout($(".startab").show(),4000); $(".startab").delay(4000).show(); JS FIDDLE DEMO 回答1: Need to use a closure setTimeout(function () { $(".startab").show() }, 4000); setTimeout takes a function as the first parameter and you were passing it an object Fiddle 回答2: setTimeout() accepts a callback and a duration and

Selecting untagged text with Jquery

拜拜、爱过 提交于 2019-12-13 01:04:51
问题 I have the following HTML; <p class="postcontent"> <img src="#"> Some Text </p> I want to be able to hide only the text. So far I have this; jQuery(function($) { $(".postcontent").$('[type=text]').hide(); }); Edit: I don't have any control over the html so I need to add it by Jquery. 回答1: You can wrap the text on the FLY and then hide it: HTML: <p class='postcontent'> <a href=#> dsds </a> aaa </p> Javascript: $('.postcontent').contents().filter(function() { return this.nodeType == 3; }) .wrap

Jquery function after page redirect?

会有一股神秘感。 提交于 2019-12-12 12:23:09
问题 Check out the fiddle! The Fiddle Im wanting to be able to link to the different sections of the content areas via links similar to the footer links in the example. However I want this functionality (Scroll to/open the section) to work when links are pressed on different pages of the site. Anglers routing system has been suggested but no idea how API history or other methods actually work or how to implement them. Another two solutions I found but cant figure out how to implement are below.