show-hide

jQuery to hide divs based on dropdown

烈酒焚心 提交于 2019-12-24 09:37:33
问题 I've gone through a lot of the posts here already on how to do this, and I've tried multiple times to implement them on my website. I'm not a developer by any means, so I'm hoping someone can help me out. I've tried different jQuery scripts and have had some success, but I can't really wrap my head around it as I've never done any real scripting myself. I'm currently using wordpress to set up a shop, and I need the ability to have users select an option from a dropdown menu. Depending on the

jQuery select menu show siblings with same ID hide other siblings

蹲街弑〆低调 提交于 2019-12-24 09:18:08
问题 I have a select menu that shows or hides list items depending on ID. Except my list has multiple LI's with the same ID value. This only shows the first LI in the list with the matching ID value. $(function() { $("#orientation").change(function() { if (this.value == 'all') { $("#images").children().show(); } else { $("#" + this.value).show().siblings().hide(); } }); $("#orientation").change(); });​ http://jsfiddle.net/dRqRV/ How can I show all sibling LI's with the same ID value? 回答1: IDs must

Show/hide Select options by class

為{幸葍}努か 提交于 2019-12-24 09:13:53
问题 I am pre-selecting the most commonly chosen options for apx. 300 Select elements, and would like to differentiate between when those values are still in their initial pre-selected/default state vs. when a user has actively chosen that value by clicking on the form element (indicating that they made an active decision to leave it set to that value) . In order to do that I am creating a pair of options for each value that is being pre-selected (with slightly different values i.e. value="50" vs.

JavaScript: Show / Hide <DIV> based on URL string

拥有回忆 提交于 2019-12-24 03:17:14
问题 I need to show a DIV on two pages (URL's) but not on the others. (I have jQuery on the pages if that helps.). I'm a complete noob so all help is very much appreciate. Thank's! Case (1) where I want to show the DIV: On the start page, when the web browser address field reads 'www.mydomin.com' The start page is PHP so I guess the full URL is 'www.mydomin.com/index.php' Case (2): 'www.mydomin.com/index.php?option=com_myblog&title.html&Itemid=1&lang=en' WHERE this part is alway the same 'www

ONLY Visible Div form elements will get submitted

陌路散爱 提交于 2019-12-24 02:19:23
问题 I have used JavaScript to hide the div s containing form elements: <script type="text/javascript"> <!-- function showMe (it, box) { var vis = (box.checked) ? "block" : "none"; document.getElementById(it).style.display = vis; } //--> </script> When certain checkbox(es) are selected the respective div (s) are shown or get visible: <form> <input type="checkbox" name="modtype" value="value1" onclick="showMe('div1', this)" />value1 <input type="checkbox" name="modtype" value="value2" onclick=

JQuery hide Class if other class is visible or shown

戏子无情 提交于 2019-12-24 01:53:22
问题 Found similar questions but nothing that covers exactly what I need. I kept it simple in my example and I want to use JQuery. I have two classes. I want to hide the "filter" div if the "category" div is shown on page load. There are currently NO styles associated with either class. I believe I am pretty close but it doesn't work. <script language="text/javascript"> if(!$(this).hasClass("category")){ $('filter').css('display', 'none'); } </script> <div class="category">By Category</div> <div

Animate Javascript show / hide button

喜你入骨 提交于 2019-12-23 21:09:58
问题 I'm building a site and in the header there is a mail icon. When you click the icon an input field and submit button appear so people can sign up for a newsletter. Is there a way to use width instead of using display:none and display:inline? So when you click the mail icon the input field is animated to slide out from the left rather than just instantly appear? Here's the javascript code im using... <!--Show & Hide Script Start--> <script language="JavaScript"> function setVisibility(id1) {

How do I hide several lines if php variable is empty?

依然范特西╮ 提交于 2019-12-23 18:50:09
问题 As a learner in PHP, I'm struggling to hide from displaying several lines, if a chosen variable is empty. I can get this to work on a basic level, but am lost when the content to be hidden gets more complicated. The concept I am aiming at is this: <?php if (isset($g1)) { ?> ((This part should not display if variable $g1 is empty)) <?php } ?> My code looks like this: <?php if (isset($g1)) { ?> <a href="img/g1.png" class="lightbox" rel="tooltip" data-original-title="<?php print $g1; ?>" data

iPhone - how may I hide a view and let it's space be used by other view (like android visibility = GONE)

牧云@^-^@ 提交于 2019-12-23 15:14:16
问题 Do you know a simple (or not simple) way to hide a view (or anything like a view) and let the other views of the screen use the place left blank ? And make the opposite when showing back that view. Something like Android Visibility = GONE for layers. As far as I know, using setHidden=YES only hide the view from the screen but does not rearrange anything around it. On Android, there are 2 hidding method. One like visibility = HIDE, and the other : visibility = GONE. Let's say we have 3 views

Animation without jquery, slide left and right

∥☆過路亽.° 提交于 2019-12-23 09:55:55
问题 I am trying to slide a div to the left when I show it and slide it to the right when I hide it, but I don't want to use jQuery. Is there a way to do simple animation and support IE7 and IE8 without using a javascript library? Here is my show/hide js: function showHide() { var Elliot = document.getElementById('Daniel').style.display; if (Elliot == "block") { document.getElementById('Daniel').style.display = "none"; } else { document.getElementById('Daniel').style.display = "block"; }; }; HTML