[Solved] Break a JSON object [closed]

http://codepen.io/anon/pen/advjeN I tried your code it’s working. did you put the Jquery CDN ? if not, put this in your header : <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js”></script> Did you put your code into a jquery function ? if not : $(document).ready(function(){ [YOUR CODE HERE] }); solved Break a JSON object [closed]

[Solved] I’m trying to make fixed header change it’s background-color after I scroll the page 100px

jQuery(document).scroll(function() { var y = jQuery(this).scrollTop(); if (y > 100) { jQuery(‘#menu’).addClass(‘scrollActive’); } else { jQuery(‘#menu’).removeClass(‘scrollActive’); } }); and just add in your CSS #menu.scrollActive { background-color: blue; // or color what you want; } solved I’m trying to make fixed header change it’s background-color after I scroll the page 100px

[Solved] copy all css property [closed]

$(‘.past’).addClass($(‘.copy’) but if you want to do it with another way Working Demo $(document).ready(function(){ $(“.copy”).click(function(){ var array = [‘color’,’width’,’height’, ‘background-color’, ‘border’]; var $this = $(this); $.each( array , function(item, value) { $(“.past”).css(value, $this.css(value)); }); }); }); another way or you can say the best way Working Demo Source (function($){ $.fn.getStyleObject = function(){ var dom = … Read more

[Solved] how to shuffle numbers with textarea in javascript

I found this great shuffle function from this answer: function shuffle(array) { var currentIndex = array.length, temporaryValue, randomIndex; // While there remain elements to shuffle… while (0 !== currentIndex) { // Pick a remaining element… randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; // And swap it with the current element. temporaryValue = array[currentIndex]; array[currentIndex] … Read more

[Solved] replace text and attribute using jquery [closed]

First, give your “a” an id, like so: <li><a id=”myAElement” href=”#” title=”LinkedIn”>LinkedIn</a></li> Now to change the title, do: $(“#myAElement”).attr(“title”,”Instagram”); To change the text displayed, do: $(“#myAElement”).html(“Instagram”); 2 solved replace text and attribute using jquery [closed]

[Solved] Why can’t I get the index of a jQuery object?

I don’t think map() is giving you want you want. Since you want to filter element from an array it’s easier to use filter() instead of map(). function $errorObjectFunction() { return $(“div[id^=name]”).filter(function() { return ($(this).find(“:first-child”).hasClass(“error”) == true || $(this).find(“.field_error”).length > 0) }); } var $self = $(“#self”); var jdks = $errorObjectFunction(); var hdjs = $self.parent().parent().parent(); … Read more

[Solved] How To replace Space by ‘+’ sign using javascript

“demo” is not an id that exists in your example. Also, I’m fairly certain you are trying to use php as javascript in there. <a id=’demo’ href=””>is you good</a> <script> const spaceToPlus = (content) => { return content.replace(/ /g, ‘+’); } let anchor = document.getElementById(‘demo’) let attributeHref = spaceToPlus(anchor.innerHTML); anchor.setAttribute(‘href’, attributeHref); </script> 0 solved How … Read more

[Solved] Disable an element/class/id from append? [closed]

Sure — add the attribute canAppend=”no” to an element then use the attribute selector like this: $(document).ready(function() { /* add the attribute selector [canAppend!=”no”] to your select or */ $(“div[canAppend!=’no’]”).append(” appended content here”); }); div { border: 2px solid black } <!– regular divs that dont have the noAppend attribute –> <div>div 1</div> <div> div … Read more

[Solved] array value by jQuery

$(document).ready(function(){ var arr = [“2″,”4″,”6″,”8″,”10”]; var index = [“1″,”5″,”9″]; var arrIndex = index.map(function(value){ return arr.indexOf(value); }) console.log(arrIndex); }) <script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js”></script> 1 solved array value by jQuery