我真的不知道这段代码发生了什么,因为我没有写它;它来自一个wordpress主题我试图修改。
基本上当使用我添加的SoundCloud URL打开prettyPhoto时,会添加“ayer.soundcloud.com/player.swf?”在我添加的soundcloud网址中间,这使得它无法正常工作。
我想要做的就是解决它,无论是解析出来还是找到问题的根源。
我发现以下代码中有一个名为flash_markup的部分:创建我的计划是获取{path}或找到它的源来解析它。
它可能来自哪里?它看起来像“path”可能是一个prettyPHoto参数?
$.fn.prettyPhoto = function (pp_settings) {
pp_settings = jQuery.extend({
animation_speed: 'fast',
slideshow: false,
autoplay_slideshow: false,
opacity: 0.80,
show_title: true,
allow_resize: true,
default_width: 500,
default_height: 344,
counter_separator_label: '/',
theme: 'facebook',
hideflash: false,
wmode: 'opaque',
autoplay: true,
modal: false,
overlay_gallery: true,
keyboard_shortcuts: true,
changepicturecallback: function () {},
callback: function () {},
markup: '<div class="pp_pic_holder"> \
<div class="ppt"> </div> \
<div class="pp_top"> \
<div class="pp_left"></div> \
<div class="pp_middle"></div> \
<div class="pp_right"></div> \
</div> \
<div class="pp_content_container"> \
<div class="pp_left"> \
<div class="pp_right"> \
<div class="pp_content"> \
<div class="pp_loaderIcon"></div> \
<div class="pp_fade"> \
<a href="#" class="pp_expand" title="Expand the image">Expand</a> \
<div class="pp_hoverContainer"> \
<a class="pp_next" href="#">next</a> \
<a class="pp_previous" href="#">previous</a> \
</div> \
<div id="pp_full_res"></div> \
<div class="pp_details clearfix"> \
<p class="pp_description"></p> \
<a class="pp_close" href="#">Close</a> \
<div class="pp_nav"> \
<a href="#" class="pp_arrow_previous">Previous</a> \
<p class="currentTextHolder">0/0</p> \
<a href="#" class="pp_arrow_next">Next</a> \
</div> \
</div> \
</div> \
</div> \
</div> \
</div> \
</div> \
<div class="pp_bottom"> \
<div class="pp_left"></div> \
<div class="pp_middle"></div> \
<div class="pp_right"></div> \
</div> \
</div> \
<div class="pp_overlay"></div>',
gallery_markup: '<div class="pp_gallery"> \
<a href="#" class="pp_arrow_previous">Previous</a> \
<ul> \
{gallery} \
</ul> \
<a href="#" class="pp_arrow_next">Next</a> \
</div>',
image_markup: '<img id="fullResImage" src="{path}" />',
flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',
iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
inline_markup: '<div class="pp_inline clearfix">{content}</div>',
custom_markup: ''
}, pp_settings);
var matchedObjects = this,
percentBased = false,
pp_dimensions, pp_open, pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth, windowHeight = $(window).height(),
windowWidth = $(window).width(),
pp_slideshow;
doresize = true, scroll_pos = _get_scroll();
$(window).unbind('resize.prettyphoto').bind('resize.prettyphoto', function () {
_center_overlay();
_resize_overlay();
});