This topic has 4 replies, 2 voices, and was last updated 5 years, 1 months ago ago by Olga Barlow
Hello, i’ve an issue with this function :
// The style function
$.fn.style = function(styleName, value, priority) {
// DOM node
var node = this.get(0);
// Ensure we have a DOM node
if (typeof node == 'undefined') {
return;
}
// CSSStyleDeclaration
var style = this.get(0).style;
// Getter/Setter
if (typeof styleName != 'undefined') {
if (typeof value != 'undefined') {
// Set style property
priority = typeof priority != 'undefined' ? priority : '';
style.setProperty(styleName, value, priority);
} else {
// Get style property
return style.getPropertyValue(styleName);
}
} else {
// Get CSSStyleDeclaration
return style;
}
};
Precisely
// DOM node
var node = this.get(0);
// Ensure we have a DOM node
if (typeof node == 'undefined') {
return;
}
It broke :
Contact Us all-in-one button
https://codecanyon.net/item/contact-us-allinone-button-with-callback-request-feature-for-wordpress/22266189
Could you tell me what is :
// DOM node
var node = this.get(0);
// Ensure we have a DOM node
if (typeof node == 'undefined') {
return;
}
Thank you
Hello,
That code is for the media player. Could you, please, describe your actions step by step when you get the error and provide Dashboard and FTP access to check and help you?
Regards
We have patched the style function (line 1970) of etheme.js file to solve our problem. We noticed that style value is directly set in the “styleName” variable (background: #00000000) and not in “value” variable. Also we have added a check condition to detect these cases for remove value in “styleName” and put it in “value”.
// The style function
$.fn.style = function(styleName, value, priority) {
// DOM node
var node = this.get(0);
// Ensure we have a DOM node
if (typeof node == 'undefined') {
return;
}
// CSSStyleDeclaration
var style = this.get(0).style;
// Getter/Setter
if (typeof styleName != 'undefined') {
// Check if value is already in style
if (styleName.indexOf(':') > 0) {
var i = styleName.indexOf(':');
value = (typeof value != 'undefined') ? value : styleName.substring(i+1, styleName.length);
styleName = styleName.substring(0, i);
}
if (typeof value != 'undefined') {
// Set style property
priority = typeof priority != 'undefined' ? priority : '';
style.setProperty(styleName, value, priority);
} else {
// Get style property
return style.getPropertyValue(styleName);
}
} else {
// Get CSSStyleDeclaration
return style;
}
};
Can you integrate it in the next template update?
Thank you,
Regards
Hello,
I have passed your solution to our developers and they told me that fix included in the next update.
Regards
You must be logged in to reply to this topic.Log in/Sign up