Posts by ohrlando • 21 points
4 posts
-
1
votes4
answers1452
viewsA: Is there an event that captures mundanes the size of an HTML element?
a workaround: var elemento = $("#teste"); var onResize = function() { elemento.css("background-color", "green"); console.log("RESIZE!!"); }; elemento.data("size", { width: elemento[0].offsetWidth,…
-
1
votes2
answers734
viewsA: Take the url of the first image of each post (div), store this url in a variable
assuming that each div of a post has the "post class": $(function() { var urlsImagens = $(".post img:nth-child(1)").map(function() { return this.getAttribute("src"); }); });…
-
-1
votes2
answers457
viewsA: Changing the innerHTML of a tag
Barter window.onload for document.onready. Probably in Jsfiddle not error because the Javascripts that are loaded are at the end of the HTML where sure they are ready.…
-
0
votes4
answers1452
viewsA: Is there an event that captures mundanes the size of an HTML element?
You can take a look at http://api.jqueryui.com/resizable/ It triggers the event resize, but is likely to fire only using the handlers it provides. an example: $( "#teste" ).resizable({ resize:…