裁片师后备
我想知道是否有一种方法可以为 Piecemaker 提供回退功能,因此当在移动设备上查看网站时,页面会回退到使用基于 javascript 的滑块。
任何帮助表示赞赏。
I was wondering if there is a way to include a fallback functionality for Piecemaker, so when a website is viewed on mobile, the page falls back to using a javascript based slider.
Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
所以我想我找到了解决这个问题的方法,遵循 crayon1 的思路并改变它嵌入 Flash 的方式,以便可以包含后备子 html。这需要更改两个文件:
JavaScriptFlashGateway.js &
piecemaker-main.php
(假设我们正在讨论 WordPress 插件)
在 JavaScriptFlashGateway.js 中,找到以下代码:
并将其更改为:
然后进一步找到这一行:“FlashTag.prototype.toString = function()”
并将整个函数替换为这样:
然后在piecemaker-main.php中,找到这一行:“var tag = new FlashTag('{$this->piecemakerSWF}', {$att['width']}+50, {$att['height ']}+100, '9,0,0');"
并将“9,0,0”替换为您需要的任何后备 html。
那么你就准备好了!希望这有帮助:)
So I think I found a way around this by following crayon1's vein of thought and changing how it embeds the flash so that fallback child html can be included. This requires changing two files:
JavaScriptFlashGateway.js &
piecemaker-main.php
(Assuming we're talking about the WordPress plugin)
In JavaScriptFlashGateway.js, find this code:
And change it to this:
Then further down find this line: "FlashTag.prototype.toString = function()"
And replace that entire function with this:
Then in piecemaker-main.php, find this line: "var tag = new FlashTag('{$this->piecemakerSWF}', {$att['width']}+50, {$att['height']}+100, '9,0,0');"
And replace '9,0,0' with whatever fallback html you need.
Then you're set! Hope this helps :)
你能弄清楚这一点吗?我不认为 Piecemaker 默认有这个选项,而且我还没有看到一种方法可以用 javascript 100% 模仿 Piecemaker 的 Flash 效果(还)。
可能有更好的方法来做到这一点,但首先想到的是使用移动浏览器检测代码(有几种可用的..不确定您喜欢哪种编码语言,但只需快速进行谷歌搜索即可您可以找到不同的选项)。然后,您可以使用 Piecemaker 作为默认显示页面版本,或者如果访问者使用移动浏览器,则显示带有您选择的 javascript/jQuery 滑块的版本。
编辑 看起来这是一个很好的替代方案,对旧版浏览器有一些后备: http ://tympanus.net/Development/Slicebox/index4.html
希望有帮助!
Were you able to figure this out? I don't think Piecemaker has this option by default and I haven't seen a way to do this with javascript that 100% mimics the Flash effects of Piecemaker (yet).
There is probably a better way to do this, but the first thing that comes to mind is using a mobile browser detection code (there are several of these available.. not sure what coding language you prefer, but just do a quick Google search and you can find different options). Then you can display either a version of your page using Piecemaker as the default or, if the visitor is using a mobile browser, display a version with the javascript/jQuery slider of your choice.
EDIT Looks like this is a good alternative with some fallback for older browsers: http://tympanus.net/Development/Slicebox/index4.html
Hope that helps!