Sphinx, reStructuredText show/hide code snippets

You don’t need a custom theme. Use the built-in directive container that allows you to add custom css-classes to blocks and override the existsting theme to add some javascript to add the show/hide-functionality. This is _templates/page.html: {% extends “!page.html” %} {% block footer %} <script type=”text/javascript”> $(document).ready(function() { $(“.toggle > *”).hide(); $(“.toggle .header”).show(); $(“.toggle .header”).click(function() … Read more

Show/Hide components in ReactJS

I’ve provided a working example that follows your second approach. Updating the component’s state is the preferred way to show/hide children. Given you have this container: <div id=”container”> </div> you can either use modern Javascript (ES6, first example) or classic JavaScript (ES5, second example) to implement the component logic: Show/hide components using ES6 Try this … Read more

Prevent onClick event when selecting text

One option is to check the type of the Selection object returned by window.getSelection: function toggleInfo() { var selection = window.getSelection(); if(selection.type != “Range”) { $(“#clicktoshow”).toggle(); $(“#information”).toggle(); } } http://jsfiddle.net/k61u66ek/4/ Update If the browser you’re targeting doesn’t expose a type property on the Selection object then you can test against the length of the selected … Read more

How to set “style=display:none;” using jQuery’s attr method?

Why not just use $(‘#msform’).hide()? Behind the scene jQuery’s hide and show just set display: none or display: block. hide() will not change the style if already hidden. based on the comment below, you are removing all style with removeAttr(“style”), in which case call hide() immediately after that. e.g. $(“#msform”).removeAttr(“style”).hide(); The reverse of this is … Read more

Android: show/hide status bar/power bar

Do you have the fullscreen theme set in the manifest? android:theme=”@android:style/Theme.NoTitleBar.Fullscreen” I don’t think you’ll be able to go fullscreen without this. I would use the following to add and remove the fullscreen flag: // Hide status bar getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); // Show status bar getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

Using jQuery, how do you find only visible elements and leave hidden elements alone?

You can use the :visible selector to find only visible. $(“.someDiv:visible”).each(….); You can use the .not() selector to find only hidden. $(“.someDiv”).not(“:visible”).each(….); I think you can perform the same operation in your code with this one line. $(“.someDiv”).hide().find(“.regular”).show(); Find all .someDiv and hide them, then find those with a .regular class and show them.

Make all opened document tabs visible

One of the built-in option to do so: use pinned tabs. http://dailydotnettips.com/2016/01/21/persevering-and-separating-the-pinned-tabs-in-visual-studio/ If you don’t want to read a external page just for setting: Tools -> Options -> Environment -> Tabs and Windows -> Show pinned tabs in a seperate row It’s not completely what you want, but it’s free and may be useful.

Show hide fragment in android

Don’t mess with the visibility flags of the container – FragmentTransaction.hide/show does that internally for you. So the correct way to do this is: FragmentManager fm = getFragmentManager(); fm.beginTransaction() .setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out) .show(somefrag) .commit(); OR if you are using android.support.v4.app.Fragment FragmentManager fm = getSupportFragmentManager(); fm.beginTransaction() .setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out) .show(somefrag) .commit();

tech