Comments (7)
Vague issue
from overlay.
var yinDaoDialog = new Overlay({
template: "<div></div>",
width: 589,
height: 408,
style: {
background: "url(/images/yindao/index-yindao1.png) no-repeat"
},
align: {
baseElement: ".t2 .wrap",
baseXY: [315, 11]
},
attrs: {
hasMask: true
}
});
yinDaoDialog.show(); 之前 修改 element align之类的
from overlay.
define(function (require, exports, module) {
var $ = require("$"),
Overlay = require("arale/overlay/1.1.4/overlay-debug"),
mask = require("arale/overlay/1.1.4/mask");
mask.set({opacity:0.7});
var yinDaoDialog = new Overlay({
template: "<div></div>",
width: 589,
height: 408,
style: {
background: "url(/images/yindao/index-yindao1.png) no-repeat"
},
align: {
baseElement: ".t2 .wrap",
baseXY: [315, 11]
},
attrs: {
hasMask: true
}
});
var YinDao = function(){};
YinDao.prototype = {
setObj: function(opts) {
},
start: function() {
// yinDaoDialog.template = '<div>哈哈</div>';
yinDaoDialog.set("template", "<div>哈哈</div>")
mask.show();
yinDaoDialog.show();
},
next: function() {
},
end: function() {
}
}
module.exports = YinDao;
});
我想用这个做一个网站的新手引导,我只想有一个Overlay的实例,那能不能每次在我的start方法里去动态改变yinDaoDialog里的各种值,然后再show(),我不知道我这样写好不好?希望你能指导一下
from overlay.
可以
from overlay.
但是
yinDaoDialog.set("template", "<div>哈哈</div>")
好像没管用
from overlay.
template 貌似比较特殊。
你可以直接:
yinDaoDialog.element.html("<div>哈哈</div>");
from overlay.
谢谢!!我发现每次new一个新的并直接传入obj更合适一些。
就像
define(function (require, exports, module) {
var $ = require("$"),
Overlay = require("arale/overlay/1.1.4/overlay-debug"),
mask = require("arale/overlay/1.1.4/mask");
mask.set({opacity: 0.7});
var yinDaoDialog;
var YinDao = function () {
};
YinDao.prototype = {
optsArr: null,
index: 0,
setObj: function (optsArr) {
this.optsArr = optsArr;
},
start: function () {
var me = this;
if (me.optsArr && me.optsArr.length) {
var obj = me.optsArr[me.index];
obj.nextBtn = obj.nextBtn || ".next-yindao";
obj.endBtn = obj.endBtn || ".end-yindao";
obj.style = obj.style || {};
obj.style.color = obj.style.color || "#FFF";
yinDaoDialog = new Overlay(obj);
obj.template.find(".next-yindao").click(function(){
me.next();
});
obj.template.find(".end-yindao").click(function(){
me.end();
});
mask.show();
yinDaoDialog.show();
}
},
next: function () {
var me = this;
yinDaoDialog.hide();
me.index++;
me.start();
},
end: function () {
}
}
module.exports = YinDao;
});
from overlay.
Related Issues (20)
- 属性trigger设置为多个选择器时的问题 HOT 6
- 建议把mask模块从overlay里分离出来 HOT 4
- mask模块建议提供工厂方法,能自由构建实例 HOT 4
- 单独使用mask时在ie6下不会创建iframe HOT 2
- _blurHide 特性和显示浮层的冲突
- 修复 https://github.com/aralejs/tip/issues/12 的后遗症 HOT 4
- 弹层弹出来后怎么回调呀 HOT 2
- spm3 安裝overlay後的問題 HOT 10
- 窗口变化后重新定位 HOT 1
- 建议修改监听window的resize事件的重定位的处理逻辑 HOT 3
- "点击空白处,隐藏"有bug,如果点击页面中的iframe就会没触发 HOT 2
- 使用focus触发时遇到的问题 HOT 3
- spm doc后在127.0.0.1查看examples页面报错 $ is not defined
- 演示网站似乎挂掉了
- mask的一些建议 HOT 3
- mask set bug
- destory 没有处理两个静态实例集合 HOT 1
- selfXY参数具体数值的含义是什么? HOT 1
- [ver. 1.1.0] _onRenderWidth 和 _onRenderHeight 令容器默认尺寸失效 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from overlay.