課程
/前端開發(fā)
/HTML/CSS
/CSS3+JS 實現(xiàn)超炫的散列畫廊特效
var c=d[i].split('<br><br>');有錯 為什么呢,還有總是說{{img}}有問題
2015-12-22
源自:CSS3+JS 實現(xiàn)超炫的散列畫廊特效 3-2
正在回答
你是不是單獨把js文件分離開了,引用的js文件放到body底部就可以了。
今天解決了前面的問題,但是出現(xiàn)另外的問題
?function g(selector)//通用函數(shù),返回被選擇的元素或元素集合?{?? return selector.substring(0, 1) == '.' ? document.getElementsByClassName(selector.substring(1)) : document.getElementById(selector.substring(1));?}
var data=data;? //輸出函數(shù),輸出所有的海報function addPhoto(){?var template=g('#wrap').innerHTML;?var html=[];?for(s in data)?{??var _html=template.replace('{{index}}',s)??????????????????? .replace('{{img}}',data[s].img)??????????????????? .replace('{{captions}}',data[s].captions)??????????????????? .replace('{{desc}}',data[s].desc);?? html.push(_html);?}???? g('#wrap').innerHTML=html.join(' ');???? rsort(1);}addPhoto();在瀏覽器中的問題是
GET file:///E:/HTML/%E7%BB%83%E4%B9%A0/%E6%B5%B7%E6%8A%A5%E8%AE%BE%E8%AE%A1/%7B%7Bimg%7D%7D net::ERR_FILE_NOT_FOUND
Uncaught TypeError: Cannot read property 'innerHTML' of null
?
追覓夢初的國度
給完整代碼看一下。
舉報
實現(xiàn)更自由的切換照片的畫廊效果,打造超酷的切換動畫
2 回答誰能幫忙解決下這個問題了:只顯示正面
2 回答PHP如何解決data.js問題
2 回答點擊過快會出現(xiàn)卡頓。怎么解決?
3 回答Chrome 中出現(xiàn)了 請問怎么解決啊。。。。。。Cannot read property 'style' of undefined
2 回答vcd,這個概念記一下
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關注慕課網(wǎng)微信公眾號
2017-02-13
你是不是單獨把js文件分離開了,引用的js文件放到body底部就可以了。
2015-12-24
今天解決了前面的問題,但是出現(xiàn)另外的問題
?function g(selector)//通用函數(shù),返回被選擇的元素或元素集合
?{
?? return selector.substring(0, 1) == '.' ? document.getElementsByClassName(selector.substring(1)) : document.getElementById(selector.substring(1));
?
}
var data=data;? //輸出函數(shù),輸出所有的海報
function addPhoto(){
?var template=g('#wrap').innerHTML;
?var html=[];
?for(s in data)
?{
??var _html=template.replace('{{index}}',s)
??????????????????? .replace('{{img}}',data[s].img)
??????????????????? .replace('{{captions}}',data[s].captions)
??????????????????? .replace('{{desc}}',data[s].desc);
?? html.push(_html);
?}
???? g('#wrap').innerHTML=html.join(' ');
???? rsort(1);
}
addPhoto();
在瀏覽器中的問題是
GET file:///E:/HTML/%E7%BB%83%E4%B9%A0/%E6%B5%B7%E6%8A%A5%E8%AE%BE%E8%AE%A1/%7B%7Bimg%7D%7D net::ERR_FILE_NOT_FOUND
Uncaught TypeError: Cannot read property 'innerHTML' of null
?
2015-12-22
給完整代碼看一下。