Re: [問題] 請問為何css style不起作用?
※ 引述《Mewra ()》之銘言:
: function createAlbum() {
: var photo = new Photo();
: }
: function Photo() {
: var frame = document.createElement('div');
: frame.className = 'frame';
: frame.addEventListener("mouseover",
: function(event) {
: alert("test");
: this.frame.style.webKitTransform = 'scale(2.0)';
: }, false);
: this.frame = frame;
: document.body.appendChild(frame);
: return this;
: }
hi,大概發現問題了,
因為this.frame不存在.
所以必需在前面先加行 this.frame = frame;
另一個觀念上的問題是,
this.frame = frame
的'='看起來是把frame reference給this.frame.
有任何method可以檢查this.frame是一個copy clone或是reference嗎?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.235.228.164
→
02/15 11:36, , 1F
02/15 11:36, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):