recentpopularlog in

kme : jquery   137

« earlier  
javascript - window.onload vs document.onload - Stack Overflow
Vanilla version currently in style seems to be something like:
<code class="language-javascript">window.addEventListener('load', function() {
console.log('All assets are loaded')
})</code>
webdevel  javascript  jquery  onload  dammitbrain 
28 days ago by kme
firebug - Access variables in jsFiddle from Javascript console? - Stack Overflow | https://stackoverflow.com/
With Firefox (34+) and the new Firefox Developer Edition, it's possibile to do the same by enabling the Select a frame as the currently targeted document extra tool into the developer tools, then click on it and select http://fiddle.jshell.net/_display/.
jsfiddle  webdevel  console  devtools  jquery  solution 
november 2018 by kme
Indeterminate Checkboxes | CSS-Tricks | https://css-tricks.com/
<code class="language-html"><!-- Inline click handler, just for demo -->
<input type="checkbox" id="cb1" onclick="ts(this)"></code>

<code class="language-javascript">
function ts(cb) {
if (cb.readOnly) cb.checked=cb.readOnly=false;
else if (!cb.checked) cb.readOnly=cb.indeterminate=true;
}</code>
webdesign  webdeve  html  jquery  css  javascript  checkbox  tristate  tipsandtricks 
may 2018 by kme
css - jQuery - making a floating element stick to another element - Stack Overflow
My solution was to take the element's (that I wanted to stick to) '$("#whatever").offset().top' and '$("#whatever").offset().height', then subtract 'document.documentElement.scrollTop', setting the result as 'theElement.offset({left: <all_that_math>})'.
javascript  webdesign  jquery  zeptojs  scrolling  solution 
september 2017 by kme
javascript - Smooth scroll to specific div on click - Stack Overflow

$("button").click(function() {
$('html,body').animate({
scrollTop: $(".second").offset().top},
'slow');
});
jquery  javascript  html  webdevel  animation  solution 
june 2017 by kme
Quick Tip: Replace jQuery's Ready() with Plain JavaScript
var callback = function(){
// Handler when the DOM is fully loaded
};

if (
document.readyState === "complete" ||
(document.readyState !== "loading" && !document.documentElement.doScroll)
) {
callback();
} else {
document.addEventListener("DOMContentLoaded", callback);
}
vanilla  javascript  onready  handler  alternativeto  jquery 
october 2016 by kme
events - Javascript callback when IFRAME is finished loading? - Stack Overflow
vote
21
down vote


I am using jQuery and surprisingly this seems to load as I just tested and loaded a heavy page and I didn't get the alert for a few seconds until I saw the iframe load:

$('#the_iframe').load(function(){
alert('loaded!');
});

So if you don't want to use jQuery take a look at their source code and see if this function behaves differently with iframe DOM elements, I will look at it myself later as I am interested and post here. Also I only tested in the latest chrome.
jquery  events  javascript  dom  iframe  webdevel  solution 
august 2016 by kme
jquery - How to select elements by attribute's value when values contains dollar sign? - Stack Overflow


You quote the value:

jQuery ('[name="ctl00$ContentPH$ucFuncionEdit1$ckEsMenu"]');

When dealing with attribute selectors, it's best to always quote the value (although if the value is a single word containing only the letters A-Z [case insensitive] and the digits 0-9 [but not starting with a digit], you can get away without).


Also works:
You can escape the $ sign with with two backslashes (\\):

jQuery('[name=ctl00\\$ContentPH\\$ucFuncionEdit1\\$ckEsMenu]');
jquery  css  selectors  webdevel  solution 
august 2016 by kme
jQuery Foundation and Dojo Foundation to Merge | Official jQuery Blog
“A library is essentially a set of functions that you can call, these days usually organized into classes. Each call does some work and returns control to the client.

A framework embodies some abstract design, with more behavior built in. In order to use it you need to insert your behavior into various places in the framework either by subclassing or by plugging in your own classes. The framework’s code then calls your code at these points.”
webdevel  jquery  dojo  library  framework  whatever 
september 2015 by kme
javascript - scroll to selected item in html listbox - Stack Overflow
Setting the selected item will only cause the item to be visible within the select field, but doesn't guarantee that it will be at the top of the list of items shown. I tried this in a jsfiddle and you'll see your code highlights the #8, but it's at the bottom of the select field box. http://jsfiddle.net/Ck4m3/
javascript  jquery  webdevel  solution 
august 2015 by kme
javascript - How do I determine scrollHeight? - Stack Overflow
So, basically, use jQuery to set scrollTop to this value:

scrollHeight is a regular javascript property so you don't need jQuery.

var test = document.getElementById("foo").scrollHeight;
javascript  jquery  solution  scrolling 
august 2015 by kme
Set value of textarea in jQuery - Stack Overflow
$("textarea#ExampleMessage").val(result.exampleMessage);
jquery  solution  dammitbrain  webdevel 
august 2015 by kme
How to hide and show initial content, depending on whether JavaScript support is available - Robert's talk [http://robertnyman.com/]
An external stylesheet actually isn't necessary. You can create all the styles in a <style> tag and head.appendChild() that instead.

<code class="language-js">(function () {
var head = document.getElementsByTagName("head")[0];
if (head) {
var scriptStyles = document.createElement("link");
scriptStyles.rel = "stylesheet";
scriptStyles.type = "text/css";
scriptStyles.href = "script-styles.css";
head.appendChild(scriptStyles);
}
}());</code>
jquery  css  javascript  elementhiding  animation  solution 
april 2015 by kme
Adds outer/innerHeight/Width methods to Zepto Adapted from https://gist.github.com/alanhogan/3935463
(function($) {
// Add inner and outer width to zepto (adapted from https://gist.github.com/alanhogan/3935463)
var ioDim = function(dimension, includeBorder) {
return function (includeMargin) {
var sides, size, elem;
if (this) {
elem = this;
size = elem[dimension]();
sides = {
width: ["left", "right"],
height: ["top", "bottom"]
};
sides[dimension].forEach(function(side) {
size += parseInt(elem.css("padding-" + side), 10);
if (includeBorder) {
size += parseInt(elem.css("border-" + side + "-width"), 10);
}
if (includeMargin) {
size += parseInt(elem.css("margin-" + side), 10);
}
});
return size;
} else {
return null;
}
}
};
["width", "height"].forEach(function(dimension) {
var Dimension = dimension.substr(0,1).toUpperCase() + dimension.substr(1);
$.fn["inner" + Dimension] = ioDim(dimension, false);
$.fn["outer" + Dimension] = ioDim(dimension, true);
});
})(Zepto);
zepto  shim  jquery  javascript  boxmodel  webdevel  webdesign  mayebsolution 
april 2015 by kme
Trent RichardsonCreating Zepto Plugins from jQuery Plugins - Trent Richardson [http://trentrichardson.com/]
outerWidth and outerHeight

outerWidth and outerHeight are not available in Zepto, but are easy to work around. You can either implement your own by adding the width + padding + border, or simply set the css attribute box-sizing: border-box and then use Zepto’s width()/height() method.
zepto  jquery  webdevel  javascript  library  solution 
april 2015 by kme
javascript - Preloading images with jQuery - Stack Overflow [http://stackoverflow.com/]
function preload(arrayOfImages) {
$(arrayOfImages).each(function(){
$('<img/>')[0].src = this;
// Alternatively you could use:
// (new Image()).src = this;
});
}

// Usage:

preload([
'img/imageName.jpg',
'img/anotherOne.jpg',
'img/blahblahblah.jpg'
]);
jquery  plugin  images  css  webdevel  webdesign  javascript  solution 
april 2015 by kme
jquery - DataTables "nCell is undefined" error with valid XHTML - Stack Overflow
I think I had a mismatch between the sort options array/hash and the actual number of columns in the table.
datatables  javascript  jquery  webdevel  maybesolution 
november 2014 by kme
« earlier      
per page:    204080120160

Copy this bookmark:





to read