dreamerslab / jquery.actual Goto Github PK
View Code? Open in Web Editor NEWGet the actual width/height of invisible DOM elements with jQuery.
License: MIT License
Get the actual width/height of invisible DOM elements with jQuery.
License: MIT License
Package.json has a trailing ',' which leads to build fail
"contributors": [
{ "name": "Ben Lin", "email": "[email protected]" },
{ "name": "Erwin Derksen" },
{ "name": "Jon Tara", "email": "[email protected]" },
{ "name": "Matt Hinchliffe", "email": "[email protected]" },
{ "name": "Ryan Millikin" },
{ "name": "Jacob Quant" },
{ "name": "ejn" },
{ "name": "Rudolf", "email": "[email protected]" },
],
Suggestion , add a link to this repo in code comments. I found the old version in packed theme plugins file and by looking at this
/*! Copyright 2012, Ben Lin (http://dreamerslab.com/)
* Licensed under the MIT License (LICENSE.txt).
*
* Version: 1.0.17
*
* Requires: jQuery >= 1.2.3
*/
I have no idea what the plugin is ( the method actual is ambiguous ) since the file was compiled about year ago and you have many repos.
this would be preferred
/*! Copyright 2012, Ben Lin (http://dreamerslab.com/)
* Licensed under the MIT License (LICENSE.txt).
* https://github.com/dreamerslab/jquery.actual
* Version: 1.0.18
*
* Requires: jQuery >= 1.2.3
*/
tested on mac os with chrome and safari
Hi, I haven't tested this, but looking at your code, inside the else-branch, there is:
var ..., style;
fix = function (){
// ...
style += 'visibility: hidden !important; display: block !important; ';
This should result in style beeing 'undefinedvisibility: hidden ...' which is ruins the visibility-attribute - I guess that's not what you wanted.
I bet there is a mistake on the latest release.
Lines 60-61 should go prior line 59 ($this.css( css );)
btw, the plugin seems to still be useful if using jQuery Mobile, even with jQuery 1.7.2.
childs of hidden elements (display:none) return height/width = 0 using the default height()/width() function
Please take notice of this jQuery bug ticket concerning return types while using the Actual plugin:
http://bugs.jquery.com/ticket/11271
Maybe you know an answer right away.
Best of Luck! And thanks for the nice plugin.
Looks like the parts that need to change are as follows:
jQuery.fn.andSelf()
needs to change to jQuery.fn.addBack()
jQuery.browser
, which is no longer supported / available, so this functionality could either depend on jquery-migrate, another library, or some native code. Since it just needs to check if the user agent is MSIE with major version < 7, perhaps it would be acceptable to perform this check natively?Perhaps
if( $.browser.msie && $.browser.version < 7 ){
could become
if( typeof navigator.appName === "string" &&
navigator.appName === "Microsoft Internet Explorer" &&
parseFloat(navigator.userAgent.replace(new RegExp(".*MSIE\\D*(\\d+.\\d+).*"), "$1")) < 7
){
See http://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx
Hello! Could you please update version number in script files, update bower package and add plugin as npm package? Thank you!
So i need to get the scrollHeight of a hidden element. But this isn't a function so it breaks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.