show-hide

show/hide layers in d3.js

泪湿孤枕 提交于 2019-12-03 13:17:53
First of all: I'm new to d3.js! I have a map and some points displayed on it. Now I want to add buttons to show/hide the points. What I have until now: function checkAll(){ d3.selectAll("g").attr("visibility", "visible"); } function uncheckAll(){ d3.selectAll("g").attr("visibility", "hidden"); } This works so far but hides/shows the whole map. I have a function "drawpoints()" that draws the points on the map. How can I change my code that it only shows/hides the points and not the whole map? You would need to select only the elements that you want to hide. If, for example, they are identified

R markdown PDF: Temporarily hide spoiler code for quiz takers

余生颓废 提交于 2019-12-03 12:45:13
I am using R markdown to create a PDF R course. I want to insert a quiz like the following: --- output: pdf_document --- What is the class of the following R object? 1. `pi` ```{r} class(pi) ``` Which, as expected, creates a PDF with this content: However, I would like the reader to not have such an easy access to the answer. These are the ideas I've had so far to achieve this: Paint the answer and code white, so the reader would have to select the text to see the answer; Include a tooltip that would work on mouse over question. Flush the answer to the end of the document; Setting the answer

Hide div element with jQuery, when mouse isn't moving for a period of time?

拟墨画扇 提交于 2019-12-03 12:19:21
问题 I have a broadcasting video site, with a menu, which should be hidden, when mouse isn't moving for a while (lets say 10 seconds). As well, it should appears back, with mouse move. What is the best way to perform that, by using css and jQuery? Thank you in advance. 回答1: Take a look at the mousemove event. You can try something like this: var i = null; $("#element").mousemove(function() { clearTimeout(i); $("#menu").show(); i = setTimeout(function () { $("#menu").hide(); }, 10000); })

Show/Hide div with scroll

拥有回忆 提交于 2019-12-03 10:04:02
I know the title isn't the most descriptive and there are many more topics with similar questions like this, but I couldn't find any answers. In fact, I got this far thanks to you guys so, here's what I'm trying to do. I have a DIV that I want to show when the page is scrolled to a certain position (trigger), marked by #othdiv . This DIV disappears when you scroll further down to the next position (trigger) marked as #othdiv2 . This feels like it's a very simple solution but I just can't figure it out. I have tried conditional if statements, duplicating codes, removing lines, new variables...

How to access Kendo Grid's column menu only from outside the grid and add the filter option for specific columns in the column header

自作多情 提交于 2019-12-03 08:39:50
I am new to Kendo Grid and trying to use the columnMenu option. I need to access the column Menu function (only the ability to show/hide columns from a button outside the grid. This link allows me to do that and it is working fine. How to show Kendo Grid's columnMenu using script But this still retains the columnMenu option in the column headers which I do not need. So after looking into it further, I was able to remove the column headers on the load using defaultGrid.thead.find("[data-field=Address]>.k-header-column-menu").remove(); where Address is one of the columns in the grid. I still do

How to show/hide grouped views in Android?

匆匆过客 提交于 2019-12-03 06:59:32
I want to create an activity such as mentioned in photo... as soon as I press the maximize button I want it to become full screen for the activity and part 1 become minimize, and again when I press the restore button I want it to become in a first state: to be able to see part 1 and part 2 ... I think if we put two layouts it is possible? Isn't it? Please refer me to a resource to help me about this, or show me the code to achieve a solution. Part one and two should be in their own layout. After, play with the visilibity property of each layout. Specifically to hide any view without it

How do I fade a div in/out on page scroll?

风流意气都作罢 提交于 2019-12-03 06:39:27
Here is the jsfiddle: http://jsfiddle.net/NKgG9/ I'm basically wanting those pink boxes to be on show on page load as normal but as soon as a user scrolls down the page I want them to fade out and disappear. When the user scrolls back up to their position or the top of the browser window I want those pink boxes to fade back in again. I'm useless with JS so good do with some help on how to do this. All help appreciated. Very simple example: http://jsfiddle.net/a4FM9/2/ var divs = $('.social, .title'); $(window).scroll(function(){ if($(window).scrollTop() <10 ){ divs.stop(true,true).fadeIn("fast

Javascript change input value when select option is selected

半世苍凉 提交于 2019-12-03 04:07:50
I am very new to javascript. So i have a select option and an input field. What i want to achieve is to have the value of the input field change when i select a particular option. This is what i have tried: First Name: <input type="text" value="colors"> <select name=""> <option>Choose Database Type</option> <option onclick="myFunction(g)>green</option> <option onclick="myFunction(r)>red</option> <option onclick="myFunction(o)>orange</option> <option onclick="myFunction(b)>black</option> </select> <script> function myFunction(g) { document.getElementById("myText").value = "green"; } function

Hide div element with jQuery, when mouse isn't moving for a period of time?

醉酒当歌 提交于 2019-12-03 03:27:29
I have a broadcasting video site, with a menu, which should be hidden, when mouse isn't moving for a while (lets say 10 seconds). As well, it should appears back, with mouse move. What is the best way to perform that, by using css and jQuery? Thank you in advance. karim79 Take a look at the mousemove event. You can try something like this: var i = null; $("#element").mousemove(function() { clearTimeout(i); $("#menu").show(); i = setTimeout(function () { $("#menu").hide(); }, 10000); }).mouseleave(function() { clearTimeout(i); $("#menu").hide(); }); Demo: http://jsfiddle.net/AMn9v/6/ 来源: https:

How do you hide the warnings in React Native iOS simulator?

孤者浪人 提交于 2019-12-03 02:08:18
问题 I just upgraded my React Native and now the iOS simulator has a bunch of warnings. Besides fixing them, how do I hide these warnings so that I can see what's underneath? 回答1: According to React Native Documentation, you can hide warning messages by setting disableYellowBox to true like this: console.disableYellowBox = true; 回答2: A better way to selectively hide certain warnings (that indefinitely show up after an upgrade to the latest and greatest RN version) is to set console