how to alter a css class directly?

Is it possible, to use javascript to edit the contents of a .css file directly? (In turn, impacting the style of the elements that use the class being modified?)  I've seen a few answers to such a question, but they all deal with the dynamic crea...

Is there a way to have the mutation observer listen to the change in cascaded style of an element?

For example I have an element say “span” which does not have a style attribute, but during runtime, the styles are cascaded and the span is decorated with some style(s) (say color/ font-size).  In this case the element itself does not have the st...

angular's $parsers on input field is having difficulty on initial input

I have the plunker link below for the full working element  http://plnkr.co/edit/Q1iZwBp6LXlun4yHs7Dq?p=preview  Here is just a brief code snippet to follow along with my question  var view_value; function fromUser(text) {      var return_value;...

Is bower package manager dying? [closed]

I Recently heard that bower package manager is dying. I didn't found any official statement from the bower team.   is there any official statement from the bower team that I can read about it? what are the good alternative for package manager? (...

How can I use a class containing dashes in ng-class of Angular.js?

In my Web App, I'm using ng-class="{highlighted_category: selected === category}" to highlight an entry when it is selected. Problems occur when I want to use e.g. pure-menu-selected because it contains dashes which Angular does not allow...

Generating a date list of the next 90 days

I am trying to cretae an array of dates for the next 90 days, filtered down to only show specific days. So for example I would like a list of all the dates that are a tuesdayin the next 90 days.  So far I have tried to simply generate an array with A...

How to create a showdown.js markdown extension

Using the following code, I get working output:  <html>   <head>     <script type="text/javascript" src="/js/showdown.js"></script>   </head>   <body>     <script type="text/javascript"&g...

How to include d3 on JavaScript non html file?

I am new to JS. Here is my question, in webstorm:  I created an empty JS file called fn under an empty project .  Then I copy the d3.js into the same project.  Then in the fn, I input:  var fn = "C:/temp/test.csv";  d3.csv(fn, function(e) {...

Image Upload and File Attachment in TinyMCE for ReactJS

I have an app that will send an email to any email. I need to integrate the following  1.Image Upload - I look into the documentation of TinyMCE but I can't get to work the Image Upload. Can I use Dropzone plugin? If this will host in S3 will the...

GatsbyJS occures `Cannot read property 'frontmatter' of null` when I tried to build

I'm trying to build my new GatsbyJS application.  This application works well when I try in gatsby develop.  But when I tried to build, Builder can't find frontmatter variant.  It seems to be like GraphQL has no problem because I can check ma...

need an event triggered if the page has scrolled 200px down (jQuery)

I want to show and hide a piece of code if i scroll and the page is for example half way, i have tried to use window scroll but this doesnt works(no errors, clean code, different browsers, different jQuery versions), but this doesn't trigger anyt...

JavaScript - opening new window in print mode after document is ready

I want to open a new window in print mode, after all images loaded(and the document is ready). Here is my code:  var win = window.open(); //css ltr win.document.write('<style>body { direction: rtl; unicode-bidi: bidi-override; }</style&g...

remove title bar ,menu bar ,navigation bar ,tab bar ,address bar and statusbar of browser

How can I remove the title bar, menu bar, navigation bar, tab bar, address bar , status bar of the browser using jquery.  The thing is that I am calling a dialog to open a poup window which should fit the monitor screen fully and should not show any...

How can I send data to my frontend js files in express

I am using ejs to render my html pages and am passing in data like this:          collection.find({}).toArray(             function (err, results) {                 res.render('index', {                     results: results,...

webpack production setup - vendors output js always has different chunk hash even though nothing's changed

The follow production webpack.config file mostly works (builds, runs ok), but one nagging problem. I set up vendor and app js outputs precisely to separate vendor code (since those don't change very often). However, with the .config setup, even i...

How to smooth scroll with ngAnimate?

I am wondering why inside my controller this does not work:  angular.module('app', [         'ngAnimate',     ])     .controller('MainCtrl', function ($scope, $log, $window, $document) {         var scrollTop = 200 // For exam...

why <nobr> does not work with Foundation widget?

I hava a problem.  <nobr>       <a href="#" class="button">Button 3</a>       <ul class="button-group">         <li><a href="#" class="button">Button 1</a></li>...

Centering draggable elements inside droppable using jquery-ui

Below is an example of what I have been able to achieve so far...    $(document).ready(function() {   $(".item").draggable({     revert: 'invalid',     snapMode: 'inner',     scroll: false,     stack: false,     drag: function...

Locale: Browser or OS Setting?

What does it mean when a "locale" is set to e.g. Japanese? Does it mean the browser is set to be ready to recognize Japanese characters? Or, is it more related to an OS setting?  Related to i18n (internationalization and localization), how do...

Run part of for only once?

I have a for loop that goes through each input with class="required" , and it its empty it changes its background color. Also, it adds a message to part of the page: "Fields with red background color are required". But, I only want th...

Catching/Overriding a Javascript redirect

How would I go about overriding/catching a javascript redirect?  For example:  window.location.href="http://example.com";   The value "http://example.com" would be caught and maybe altered....

How to check if array includes string in PUG template

I am using NodeJS with Express and the PUG view engine.  I am attempting to check if an array contains a certain string. I have tried the builtin javascript methods such as:  array.includes(str) array.indexOf(str) > -1.   However neither of these...

How do I access depth data in three.js

I've seen shaders that create an outline around edges dynamically based on how much difference there is between the depth (distance from camera to surface) of a pixel at an edge and the depth of a pixel adjacent to it (less depth can mean a thinn...

type.js with html entities

I am trying to use type.js to animation a code example but th problem is it types the characters of the html entity first then coverts to the corresponding html character.  Example:  I want to type <!DOCTYPE html> so I have use &lt;!DOCTYPE...

Page transition animations with Angular 2.0 router

In Angular 2 I am trying to animated in new components via the Router onActivate method.  I have set up a Plunk with a demonstration of the issue here: http://plnkr.co/FikHIEPONMYhr6COD9Ou  An example of the onActivate method in one of the page compo...

Javascript - Find path to object reference in nested object

How can i recursively search a nested object to find the PATH to an object reference I'm providing?  My original object looks like:  a = {  b: [   { children: [...more objects] },   { children: [] }   etc..  ],  c: [   { children: [...more object...

How to check valid expression before evaluate?

My below code work perfect when valid maths expression but do not work when expression is invalid.  HTML Code  <button id="calc">Calculate</button> <p id="demo"></p>   jQuery code  function myFunction() {     v...

Drag and drop with interact.js

I am trying to build an interface that allows both resize/drag and rotate on some element and to achieve this I am using interact.js javascript library.  I have my interact functions working:      interact('.resize-drag-ratio')       .draggab...

autocomplete How to avoid duplicate selection

I am using JQuery autocomplete. In which i want to avoid duplicate selection of pre-selected and pre-located (pre fetched) list.  The following script works with currently selected list. But how can I do it with pre-located list which are fetched wit...

Protractor page object issues

I seem to be stuck in the construction of page objects. I read a lot of docs about page objects and know that they contain two things:   elements that are present on a page functions to interact with the page   When I check example files I see that t...