Embed code doesn't work

SAdesigns

New member
The popup code works, if I try to embed it in the page nothing shows up.

The second link has the popup.

[links removed]
 

SAdesigns

New member
Ok, I got it to work. If there is a space in the shortcode name then it doesn't work. Now just need to get the fullscreen button back.
 

WebSupport

Active member
Seems to be some conflict with your other CSS stylesheets or possibly the version of jQuery and how it calculates element width (will test with 1.10.2 shortly).

Simple fix is to find this file:
/wp-content/plugins/webrotate-360-product-viewer/imagerotator/html/css/basic.css

and set width here to say 180px;

.wr360_player .container .theme_panel .toolbar
{
width:180px;
position:relative;
height:35px;
margin:1px auto -1px auto;
padding:0 10px 0 10px;
}

I hope this helps.
 

WebSupport

Active member
It did work fine on that other test page you have as I tried it in firebug with the fixed toolbar width.

As for the other one with the expander on your product page, the issue is on the line 1152 in your theme's shortcodes.js that intercepts clicks on all "a" elements on the page. It can't find href attribute in the full-screen button (a) element and asserts on replace, so I suggest to limit the scope of this click handler to not include 360 viewer buttons or check if $(this).attr('href') is defined before handling replace.

/wp-content/themes/enfold/js/shortcodes.js

line 1152:

$('a').on('click',function(){
var hash = $(this).attr('href').replace(/^.*?#/,'');
if(hash) trigger_default_open('#'+hash);
});

You can add this right before the line in bold:

if ($(this).attr('href') == 'undefined') return;

I hope this helps!
 

WebSupport

Active member
Hi!

I just refreshed my browser cache, reloaded the page and I don't see the line you suggested above you added (may be you removed it already?). Please see my firebug window with the asserting snippet that doesn't show the check for the missing attribute, and it still produces the same error at that line when I hit the full-screen button. Please confirm when the line is added and we will go from there.
 

Attachments

  • 1-29-2014 9-56-59 AM.jpg
    1-29-2014 9-56-59 AM.jpg
    49.2 KB · Views: 2,842
  • 1-29-2014 9-52-43 AM.jpg
    1-29-2014 9-52-43 AM.jpg
    70 KB · Views: 2,842

WebSupport

Active member
Please change that line you added to this one: if (!$(this).is('[href]')) return;

Another option:

var attr = $(this).attr('href');
if (typeof attr === 'undefined' || attr === false) return;
 
Top