show-hide

Hide parent div on click using jQuery

拈花ヽ惹草 提交于 2019-12-19 06:18:07
问题 So I'm trying to write a super simple script that will allow a user to throw any link or button with the class .close inside of a div, and when that .close link is clicked, it automatically closes the parent container. Here is what I'm currently trying to work with: JSFiddle The code that I am currently trying to use is: HTML <div class="well notice bg-green"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> <p>This is a notice that is green.</p> </div>

Show a div onclick and hide the image that triggered it

荒凉一梦 提交于 2019-12-18 08:47:14
问题 I would like to use the following code to display a hidden div onclick, but then when the it is displayed, I want the image that I used to trigger it to disappear. Here is what I have so far: HTML: <img src="Icons/note_add.png" onclick="show('comment')"/>  <div id="comment" style="float:left;display:none;"><textarea name="textfield6" cols="30" rows="2" id="textfield4" class="text"></textarea> <a href="#" class="buttonintable">Submit</a></div> JS: function show(target){ document.getElementById

Hide MAAttachedWindow when clicking outside

梦想与她 提交于 2019-12-18 03:46:23
问题 I'm using an MAAttachedWindow to display a custom window under a NSStatusItem in the Menubar. Everything works fine, but I can't find an easy way to hide it when the user clicks outside of the window. I want to implement this behavior because it's what the user expects. This is the code used to display the MAAttachedWindow : - (void)toggleAttachedWindowAtPoint:(NSPoint)pt { if (!self.attachedWindow) { self.attachedWindow = [[MAAttachedWindow alloc] initWithView:logView attachedToPoint:pt

Prevent onClick event when selecting text

独自空忆成欢 提交于 2019-12-18 03:05:10
问题 I've got this problem where I need to show and hide divs when clicking on a table cell. However, I also want people to be able to select text and copy it within the cell without hiding the information. Totally open to changing the design if necessary. :) Here's a fiddle which demonstrates the issue http://jsfiddle.net/k61u66ek/1/ Here's the HTML code in the fiddle: <table border=1> <tr> <td> Information </td> <td onClick="toggleInfo()"> <div id="information" style="display:none"> More

Show/Hide div when checkbox selected [closed]

99封情书 提交于 2019-12-17 19:53:05
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . I need to make additional content appear when a user selects a checkbox. I have the following code: <!DOCTYPE html> <html> <head> <title>Checkbox</title> <script type="text/javascript"> $(document).ready(function(){ $('#checkbox1').change(function(){ if(this.checked) $('#autoUpdate').fadeIn('slow')

jQuery and css: hide/show select options with a certain css class

感情迁移 提交于 2019-12-17 19:18:15
问题 In the html code I have select options like this: <option value="1" class="myclass5">Value1</option> In jQuery: var cod = $(this).val(); // This is the value of another select: when the value $("option[class^=myclass]").hide(); $("option[class^=myclass]").each(function () { $("option[class^=myclass" + cod + "]").show(); }); EDIT I have two select. When I select a value in the first select, the second one must be populated accordingly (I have to prevent an ajax call). I put all the second

C# winforms startup (Splash) form not hiding

纵然是瞬间 提交于 2019-12-17 10:42:50
问题 I have a winforms application in which I am using 2 Forms to display all the necessary controls. The first Form is a splash screen in which it tells the user that it it loading etc. So I am using the following code: Application.Run( new SplashForm() ); Once the application has completed loading I want the SplashForm to hide or me sent to the back and the main from to be show. I am currently using the following: private void showMainForm() { this.Hide(); this.SendToBack(); // Show the GUI

Show/Hide components in ReactJS

心不动则不痛 提交于 2019-12-17 10:27:09
问题 We have been experiencing some problems in using react now but it kinda boils to one part of how we have been using react. How should we have been showing/hiding child components? This is how we have coded it (this are only snippets of our components)... _click: function() { if ($('#add-here').is(':empty')) React.render(<Child />, $('#add-here')[0]); else React.unmountComponentAtNode($('#add-here')[0]); }, render: function() { return( <div> <div onClick={this._click}>Parent - click me to add

Hide all next tr td until next tr th

梦想与她 提交于 2019-12-14 04:19:47
问题 it should be simple but this jQuery function are taking a element to much, it even hide the jQuery I think. What I will like to do, is when a person click a tr th , all next tr td should be hide until next tr th . How can I get this code to work?? <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <style> th { background:#dad; font-weight:bold; font-size:16px; width: 50%; } td { background:red; font-weight:bold; font-size:16px; width: 50%; } </style>

Javascript show/hide will not hide properly in Safari

删除回忆录丶 提交于 2019-12-14 04:09:43
问题 It seems to be a problem with show/hide in Safari. The site looks good freshly loaded. But if you click on the first link up in the left corner and than go back, the show/hide function doesn't work so well anymore and you get layers on top of each other. Note: This problem only occours in Safari. I've used jQuery and here is my show hide code: <script type="text/javascript"> function show(id) { document.getElementById(id).style.visibility = "visible"; } function hide(id) { document