toggle

How to implement Read more / Read less in pure CSS

夙愿已清 提交于 2019-11-30 16:48:04
I am implementing a CSS read more / read less capability using http://codepen.io/Idered/pen/AeBgF as a starting point. I modified it to work off <p> tags vs. <li> list items. I can't get the code to work on my page at http://bit.ly/1L5vMm7 Here is my version of the CSS: input.read-more-state { display: none; } p.read-more-target { font-size: 0; max-height: 0; opacity: 0; transition: .25s ease; } input.read-more-state:checked ~ div.read-more-wrap p.read-more-target { font-size: inherit; max-height: 999em; opacity: 1; } input.read-more-state ~ label.read-more-trigger:before { content: 'Read more

TinyMCE 4 toggle toolbar button state

允我心安 提交于 2019-11-30 15:55:53
What is the simplest way to toggle the state of a toolbar button (like it works with the default bold-button)? I can't "get" to that class i Tinymce that changes the button's look from default to selected. This is my plugin code (simplified): tinymce.PluginManager.add('myplugin', function (editor) { editor.addButton('mybutton', { text: false, image: 'someimage.png', onclick: function () { /* Toggle this toolbar button state to selected (like with the tinymce bold-button)*/ /* and of course some other code goes here */ } }); }); In TinyMCE 4 you can use the simpler stateSelector setting: editor

Getting Checked rows from gridview in asp.net

痴心易碎 提交于 2019-11-30 15:20:36
I have a GridView in ASP.net where I have a CheckBox column. The user can toggle the CheckBox . Now, what I want is that when the user clicks on a button, all the records from the GridView where the CheckBox is checked should be displayed. And on another button, the opposite state should be displayed... I am not getting the logic for the same. Can anyone please help me with the logic.. Genzume You could iterate through the GridViewRow s and check if the CheckBox is checked using something like the following Edit from comments, fixed small bugs. Thanks guys. (3/20/2013): foreach (GridViewRow

Switching between earpiece and speakerphone on button press

爷,独闯天下 提交于 2019-11-30 14:01:58
问题 I am trying to play audio from both the speakerphone and earpiece by having a button toggle between the two. The problem is that I am trying to default the audio to play from the earpiece, but nothing comes out. Then when I press the button to toggle to speakerphone, still no audio plays. I am playing from a local raw file. I have android.permission.MODIFY_AUDIO_SETTINGS in the Manifest as well. Here is my code: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

How to slide down a div then .fadeIn() the content and vice versa?

烂漫一生 提交于 2019-11-30 13:28:41
Goal When a user clicks the button, the div in question will: slide down stop fade in the content When the user clicks the button again, the div will: fade out stop slide up Current position Here is an example where the fadeIn and fadeOut is happening at the right time but there is no slide effect before and after the fadeIn and fadeOut respectively http://jsfiddle.net/tkRGU/1/ Also there is this option which has the slideToggle function but does not have the fadeIn and fadeOut occuring after and before the slide respectively. http://jsfiddle.net/MY8DD/7/ Solid Source This will work: HTML: <a

Dojo Toggle Hide and Show Divs

主宰稳场 提交于 2019-11-30 11:36:19
I've done some searching and come up with a lot of mixed results for using Dojo to toggle divs showing vs hidden. Some use dojo.style which it looks like might have been replaced by dojo.fx Some use dijit but thus cannot access a DOM node. Some make use of show() and hide() Some change the CSS I can't seem to get any of them to work. Can someone please point me towards an up-to-date walkthru on this. Solved Used a combination of the following... dojo.addOnLoad(function() { dojo.style(dojo.byId('myDiv'), "display", "none"); }); and to toggle it function toggleDivs(){ if( dojo.style(dojo.byId(

Trigger a button on page load

与世无争的帅哥 提交于 2019-11-30 09:44:11
I have this function $("a#<?php echo $custom_jq_settings['toggle']; ?>").click(function() { jQuery("#<?php echo $custom_jq_settings['div']; ?>").slideToggle(400); jQuery("#featurepagination").toggle(); jQuery("#featuretitlewrapper").toggle(); return false; }); And this is the button I want to trigger on page load <a href="#" id="featuretoggle" onclick="changeText('<?php if (is_front_page()) {?>Show<?php } else { ?>Show<?php } ?> Features');"><?php if (is_front_page()) {?>Hide<?php } else { ?>Hide<?php } ?> Features</a> I would like to trigger that button when the page loads so that it starts

Switching between earpiece and speakerphone on button press

无人久伴 提交于 2019-11-30 09:19:27
I am trying to play audio from both the speakerphone and earpiece by having a button toggle between the two. The problem is that I am trying to default the audio to play from the earpiece, but nothing comes out. Then when I press the button to toggle to speakerphone, still no audio plays. I am playing from a local raw file. I have android.permission.MODIFY_AUDIO_SETTINGS in the Manifest as well. Here is my code: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); context = getActivity().getBaseContext(); am = (AudioManager) context.getSystemService

jQuery fadeToggle if currently animated, ignore further input

你说的曾经没有我的故事 提交于 2019-11-30 09:06:02
问题 I've got some thumbnails that have a play button that fades in on top of them when you hover. My issue is that when you hover over them repeatedly, say three times, they fade in and out three times. I once ran into a jQuery function that included an if then statement roughly saying if it's animated disregard further input.. But I'm not sure what the syntax is to do such a thing. Ideas? Thank you! Here's a jsFiddle: http://jsfiddle.net/danielredwood/66FwR/10/ HTML: <div id="music_right"> <div

Drop down menu with on click toggle

强颜欢笑 提交于 2019-11-30 08:03:12
I am attempting to create a drop down menu which activates on click rather than on hover. So far I have the on click working with a little javascript, but whilst the sub menus show well and if another menu is clicked other submenus hide, I can't work out how to hide a sub menu if its parent is clicked. EG in this JS fiddle I can click on "parent 1" to reveal its children and when I click on "parent 2" parent 1's children hide and Parent 2's children show. But if Parent 1's children show I want to be able to hide them by clicking on Parent 1 again, (or even better anywhere outside the children)