toggle

CartoDB multiple layer toggle

╄→гoц情女王★ 提交于 2019-12-24 07:16:06
问题 I'm trying to make one map where you can toggle between three different layers, and keep the same legend visible for all. I'm currently following this documentation: http://docs.cartodb.com/tutorials/toggle_map_view.html My map in CartoDB has three separate layers (w/ three datasets for the years 2013, 2014 and 2015). I'm trying to make a toggle map like the one in the documentation. Here's what I go so far: <html> <head> <link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/3

CSS Toggle transition animation

江枫思渺然 提交于 2019-12-24 06:17:20
问题 I have 2 CSS toggle buttons I am making. Right now when you click the button has a fade in and out effect. I want to to act more like a sliding from right to left animation. Attached is the HTML, CSS and a l ink to a fiddle with my code. Thank you! https://jsfiddle.net/ebgpqvha/ <div class="switch-field"> <div class="switch-title">Hand:</div> <input type="radio" id="switch_left" name="switch_2" value="yes" checked/> <label for="switch_left">L</label> <input type="radio" id="switch_right" name

How to toggle auto scroll function / reverse page scroll?

送分小仙女□ 提交于 2019-12-24 05:47:07
问题 I have a website with one big horizontal div. It automatically scrolls vertically and horizontally onload (I used this javascript as discussed here: smooth auto scroll by using javascript): function pageScroll() { window.scrollBy(10,-10); // horizontal and vertical scroll increments scrolldelay = setTimeout('pageScroll()',100); // scrolls every 100 milliseconds } What I would like to know but can't figure out: is it possible to toggle this function? I would like that once the page

Toggle visibility of sibling element jquery

混江龙づ霸主 提交于 2019-12-24 03:55:13
问题 I have several divs on a page. Each div has a heading which I can click to toggle visibility of the corresponding div. The divs are set to display:none by default. I have used #ids in the click functions of each of the divs , however since I have several divs on the same page. I would want to use a single .class so that I have a single class thus a single function that controls the visibility. I am guessing i would then need to use .parent and .sibling classes to do this. Below is an excerpt

Toggle/Show one defined DIV with JS

元气小坏坏 提交于 2019-12-24 03:04:01
问题 I have a fiddle for you: http://jsfiddle.net/vSs4f/ I want to show the div.sub-menu with a simple click on a.haschildren . If the body loads the div.sub-menu should be closed. If I click a second time on a.haschildren the div.sub-menu should be close. I have sampled so many things but I think the problems are the lot of DIV's. One idea is in the fiddle. $(function() { $("a.haschildren").click(function(e) { e.preventDefault(); $('div.sub-menu:visible').hide(); $(this).next('div.sub-menu').show

Toggle DIV state localstorage

我怕爱的太早我们不能终老 提交于 2019-12-24 02:44:19
问题 Earlier today i asked a question on here, but didnt explained it properly and havent provided proper code. I have 2 toggle DIVs with links in them, and once user opens one and clicks on the link, page refresh with results, but that DIV closes itself. I would like it to remain open. $(document).ready(function() { $(".content").hide(); $(".fa-angle-double-up").hide(); $(".heading").click(function(){ $(this).next(".content").slideToggle(500); $(this).find(".fa-angle-double-up, .fa-angle-double

4 toggle buttons speak javascript to each other but none of them are good listeners- the sequel: stupidity strikes back

戏子无情 提交于 2019-12-24 01:53:58
问题 This is the sequel to this thread: 4 toggle buttons speak javascript to each other but none of them are good listeners Our heros have overcome the ridiculous amount of nonsense originally presented in the fiddle http://jsfiddle.net/EjW7A/8/ (no longer available) when @nbrooks -reinvigorated by the forces of good- conquered all of the stupidly placed arrays, functions and the mammoth amount of redundant content with his solution: http://jsfiddle.net/EjW7A/24/ We rejoin Luhring after 8 hours of

Toggling MapKit Overlays On/Off by pressing the same button?

北城以北 提交于 2019-12-24 00:48:35
问题 I have a MapView with a toolbar button that when pushed adds overlays to the MapView. What I would like is for the button (IBAction) to check to see if there already are overlays on the map and if there are remove, if there are not, to add them. My current code that adds the overlays is as follows: - (IBAction)waterWaysAction:(id)sender { NSLog(@"WaterWays pushed"); if ([mapView overlays]) { [mapView removeOverlays:[mapView overlays]]; NSLog(@"WaterWays removed"); } else { // ******* adds the

jQuery toggleClass callback how to?

亡梦爱人 提交于 2019-12-23 19:53:18
问题 I have this simple jQuery event with toggleClass : $(this).on("click", function() { $(this).toggleClass("fa-stop-circle"); }); I would like to call some method if fa-stop-circle is added. How can I monitor this event? 回答1: toggleClass() doesn't have a callback, however you can check if the element has the class immediately after calling toggleClass() , like this: $(this).on("click", function() { var $el = $(this).toggleClass("fa-stop-circle"); if ($el.hasClass('fa-stop-circle')) { // do

Bootstrap 4 - Dropdowns only work one times with tabs menu

落花浮王杯 提交于 2019-12-23 17:31:01
问题 In bootstrap-4, the first time I click a dropdown in a tab menu it works fine, but after that it stops working. <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <li class="nav-item"> <a class="nav-link active" href="#home" role="tab" data-toggle="tab">Home</a> </li> <li class="nav-item"> <a class="nav-link" href="#profile" role="tab" data-toggle="tab">Profile</a> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button"