toggle

Mapbox how to set up the menu so that only the “visible” layers are in an “On” state

浪尽此生 提交于 2019-12-11 17:17:45
问题 I have created a menu that allows me to toggle layers on and off. When the map initially displays, I want only two layers to be turned on. I have been able to turn off the layers i want off during the initial display using: map.on('load', function() { map.setLayoutProperty('id', 'visibility', 'none'); }); However, after several attempts, I haven't been able to have the menu display the layers that are off in a toggled "Off" state. You can find the current map here (If you toggle the first two

jQuery toggle on each?

筅森魡賤 提交于 2019-12-11 16:53:59
问题 im using jquery to toggle some paragraphs. its pretty easy with just one paragraph but say i have a very generic setup. the second paragraph is initially hidden with css. <p>some text</p> <p>some more text</p> <a href="#" class="more">read more</a> <p>some text</p> <p>some more text</p> <a href="#" class="more">read more</a> problem is that every time i click one of the "read more" links its shows the every second paragraph. i would just want it to show the second paragraph of the one clicked

My simple key listener isn't working. It doesn't seem to toggle the pressed boolean. (Java)

风格不统一 提交于 2019-12-11 16:49:06
问题 I'm using this for a simple 2.5D game but my keys don't seem to toggle. It isn't a problem while calling it in the main class as placing println statements in the if statements didn't run. Thanks ahead of time. import java.awt.event.KeyEvent; import java.awt.event.KeyListener; public class InputHandler implements KeyListener { public InputHandler(Game game) { game.addKeyListener(this); } public class Key { private boolean pressed = false; private int numTimesPressed = 0; public boolean

Multiple ToggleSwitch instances get same data from the List (ListView) using C# in UWP

淺唱寂寞╮ 提交于 2019-12-11 16:21:57
问题 This is my first experience with ToggleSwitch. What I am trying to achieve is to show different data from the list using different ToggleSwitches. I have a ListView with multiple TextBlocks and one ToggleSwitch for each row of data. Then I populate ListView with data from List. (List is populated using class that forsees public ToggleSwitch Switch {get; set;} Here is how I try to get ToggleSwitch data from each row: private void ToggleSwitch_Toggled(object sender, RoutedEventArgs e) { for

jquery pause/resume timer toggle

荒凉一梦 提交于 2019-12-11 15:09:11
问题 I've got this simple countdown timer - $(document).ready(function() { var Clock = { totalSeconds: 800, start: function () { var self = this; this.interval = setInterval(function () { self.totalSeconds -= 1; $("#hour").text(Math.floor(self.totalSeconds / 3600)); $("#min").text(Math.floor(self.totalSeconds / 60 % 60)); $("#sec").text(parseInt(self.totalSeconds % 60)); }, 1000); }, pause: function () { clearInterval(this.interval); delete this.interval; }, resume: function () { if (!this

jQuery toggle dynamically

99封情书 提交于 2019-12-11 13:58:22
问题 I want to toggle divs dynamically. Here is what I found so far... $(".toggle").click(function() { $(this).next('.container').toggle('fast'); }); What I have is this (HTML): <h4 class="toggle">1</h4> <h4 class="toggle">2</h4> <h4 class="toggle">3</h4> <div class="container">Content1</div> <div class="container">Content2</div> <div class="container">Content3</div> When I click the FIRST element (h4 with class toggle) I want the FIRST element with class container to open / close. When I click

AJAX appended collapsible rows to a jQuery/javascript Tablesorter table lack needed attributes

[亡魂溺海] 提交于 2019-12-11 13:10:34
问题 I'm trying to append rows upon scrolling of a table using a modified version of Tablesorter.js: http://www.pengoworks.com/workshop/jquery/tablesorter/tablesorter.htm. It is modified in the sense that it allows for collapsible rows. The problem I'm having is that upon scrolling and an AJAX call to load new rows, these new rows are lacking the attributes of the other rows that allow them to be toggleably collapsed/expanded. Here's some issues with the HTML for these appended rows: the clickable

Application Crashes - Silent Mode Toggle - Android for Dummies

巧了我就是萌 提交于 2019-12-11 13:07:12
问题 I finished the code for the Silent Mode Toggle Application (android apps for dummies). My code is identical with the one in the book, with little exceptions because of the newer android. Everything works fine, but if I start the app, it crashes with the error message: Unfortunately, Silent Mode Toggle has stopped. I found out, that the problem is something with the setOnClickListener method. There are no little compile errors, eclipse says everything is cool. The relevant part of the Code:

expand image while hiding other divs

邮差的信 提交于 2019-12-11 12:40:46
问题 I am currently using both the fancybox thambnails and button helper. Currently I have it all working how I would like but I would like thumbnails below the slide to disappear when the image is expanded and the excess space above the enlarged image gone. It's too messy having both, they overlap and do all sorts of weird stuff and I don't really think you need the thumbnails (navigation dots) when the image is enlarged. Any help would be great. If it helps, you can view the issue on my website

Slide Toggle [Jquery Function] Not Working

陌路散爱 提交于 2019-12-11 12:07:50
问题 I use this code to run a slide toggle but it doesn't open when I click on it: JS Code: <script type="text/javascript"> $(document).ready(function () { alert('hi i came to toggle'); $(".flip").click(function () { $(this).next().slideToggle("fast"); }); }); function ViewGetSubjects(data) { var subjects = (typeof data) == 'string' ? eval('(' + data + ')') : data; $('#subjects').empty(); for (var i = 0; i < subjects.length; i++) { $('#subjects').append('<h1 class = "flip">'+subjects[i].Wkp_lesson