show-hide

Hide MAAttachedWindow when clicking outside

最后都变了- 提交于 2019-11-29 02:44:15
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 inWindow:nil onSide:MAPositionBottom atDistance:5.0]; [self.attachedWindow setLevel:kCGMaximumWindowLevel];

Show/Hide with Checkbox using jQuery

让人想犯罪 __ 提交于 2019-11-29 02:17:13
I am trying to have a section of an html form to show/hide based on a checkbox. This is the essence code I have: <script src="/js/jquery.js"></script> <script language="JavaScript"> function toggle(className){ var $input = $(this); if($(this).prop('checked')) $(className).show(); else $(className).hide(); } </script> <fieldset><legend>Check Here <input type="checkbox" onclick="toggle('.myClass')" ></legend> <span class="myClass"> <p>This is the text.</p> </span> </fieldset> When you click on the checkbox, the span gets hidden and will not come back. I have also used $(this).is(':checked') . It

Show/Hide Div on Scroll

£可爱£侵袭症+ 提交于 2019-11-29 01:01:24
问题 I have a div that sits at the bottom of a slideshow that I want to disappear when the user scrolls or uses down arrow then reappears when scrolls back to the top. I am guessing this is incorporating the jquery scroll functionality? 回答1: <div> <div class="a"> A </div> </div>​ $(window).scroll(function() { if ($(this).scrollTop() > 0) { $('.a').fadeOut(); } else { $('.a').fadeIn(); } }); Sample 回答2: $(window).scroll(function () { var Bottom = $(window).height() + $(window).scrollTop() >= $

show/hide div based on browser size using ONLY css?

穿精又带淫゛_ 提交于 2019-11-28 18:22:16
I am a trying to get some divs to show/hide based on browser size, using only css media queries... but nothing seems to be working... please help if you can and let me know what i'm doing wrong... thanks in advance! heres my css.. @media all and (max-width: 959px) { .content .700{display:block;} .content .490{display:none;} .content .290{display:none;} } @media all and (max-width: 720px) { .content .700{display:none;} .content .490{display:block;} .content .290{display:none;} } @media all and (max-width: 479px) { .content .700{display:none;} .content .490{display:none;} .content .290{display

Android: show/hide status bar/power bar

我是研究僧i 提交于 2019-11-28 17:28:47
I am trying to create a button where I can hide or show the status bar on my tablet. I've put in the onCreate getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN); getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); and in the buttons show: WindowManager.LayoutParams attrs = getWindow().getAttributes(); attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN; getWindow().setAttributes(attrs); hide: WindowManager.LayoutParams attrs = getWindow().getAttributes(); attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; getWindow().setAttributes(attrs);

Android Studio: invalidateOptionsMenu() causes the always visible items to stop working

只谈情不闲聊 提交于 2019-11-28 12:48:05
问题 I am trying to hide/show an always visible item ( app:showAsAction="always" ) of a menu after a Switch is off/on. The issue is: if I use invalidateOptionsMenu() in onPrepareOptionsMenu() , my searchView and savebutton menu.findItem(R.id.save_product_option) stop working. They are visible but do not answer to the click. If I do not use invalidateOptionsMenu() , the items work as expected. But the savebutton only gets hiden ( menu.findItem(R.id.save_product_option).setVisible(false) ) when I

Hide/show outputs Shiny R

北城以北 提交于 2019-11-28 12:45:51
I am trying to find out how to show and hide my outputs like graphics and tabels each time when the user change something in the widjets. For instance I have a slider input for my variable called "gender" with 2 choices : male and female. I also have a button which executes estimations when the user click on it. I want to hide the outputs each time when the user changes at least one choice between the different widjets. For instance after one estimation the user decides to change only the level of education and when the user click on the sliderInput box, I would like to hide the previous

Show/Hide div when checkbox selected [closed]

 ̄綄美尐妖づ 提交于 2019-11-28 11:36:05
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'); else $('#autoUpdate').fadeOut('slow'); }); }); </script> </head> <body> Add another director <input type="checkbox" id="checkbox1"/> <div id="autoUpdate" class="autoUpdate"> content </div> </body> </html> Would really appreciate some help, good knowledge of HTML5, CSS3 but very basic JavaScript

Dynamic Flot graph - show hide series by clicking on legend text or box on graph

半世苍凉 提交于 2019-11-28 09:49:36
I am working on dynamic flot graph with 3 series. My need is to hide/show series when clicked on legend. I have seen different examples that will work fine for static graphs but for dynamic graph, even it works first time but when graph is updated with new data values then everything is displaying with default options. once I hide the series, I want it to be hided until I click again to show it. Here's a quick example I put together for you. somePlot = null; togglePlot = function(seriesIdx) { var someData = somePlot.getData(); someData[seriesIdx].lines.show = !someData[seriesIdx].lines.show;

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

瘦欲@ 提交于 2019-11-28 09:46:07
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 select values in a session var, but my problem is in selecting only those ones tied to the first select, so