在使用百度clouda+的blendui开发,想实现一个页面跳转,点击按键事件有效果,但页面不跳转。
document.addEventListener("blendready", function ()
{
Blend.ui.layerInit("intro", function (dom)
{
$('#jump1', dom).click(function (e)
{
Blend.ui.fire("createContentLayer", "intro");
document.getElementById("intro").innerHTML=Date();
});
var contentLayer;
Blend.ui.on("createContentLayer", function (event)
{
if(Blend.ui.get("content"))
{
contentLayer.in();
document.getElementById("intro").innerHTML="<b>shijian if</b>";
}else{
document.getElementById("intro").innerHTML="<b>shijian else</b>";
contentLayer = new Blend.ui.Layer({
"id": "content",
"url": "content.html",
"active": true
});
}
});
//回退事件处理
Blend.ui.on("back", function (event)
{
contentLayer.out();
});
});
Blend.ui.layerInit("content", function (dom) {
$('#nav-back', dom).click(function (e) {
//触发回退操作
Blend.ui.fire("back", "0");
});
});
});
认证高级PHP讲师