找到一個simulate.js,可以模擬鍵盤和鼠標的點擊時間,簡單測試了下,似乎可以。
var e = this.canvas;
var t = jQuery.simulate.keyCode;
//模擬down鍵
$(e).simulate('keydown', {keyCode: t.DOWN})
option配置里直接設置背景色就可以了
backgroundColor:"#fff",還可以寫rgb格式與漸變色
倒計時結(jié)束后,把timer重新賦值6就行了
ios 下的 fixed 是假的,感覺上是通過絕對定位做的東西
可以在body下絕對定位一個100%大小的div,來實現(xiàn)這種全屏的覆蓋
要注意的就是這時候的body就不能滾動了,得用div滾動
html
body
div.fixed
div.scroll
css
html,body,.scroll
width:100%
height:100%
overflow:hidden
position:relative
.scroll
overflow:auto
.fixed
position:absolute
width:100%
height:100%1.Z-INDEX常用于同級之間比較
<div>
<div class="first common">
i am the first div.
</div>
<div class="second common">
i am the second div.
</div>
<div class="third common">
i am the third div.
</div>
</div>
這樣的div結(jié)構(gòu)設置z-index,輕松愉快愉快。
2.像父子關(guān)系的,父元素不設置z-index,設置子元素為負值,即可實現(xiàn)父元素在上的效果
<div class="first common">
i am the first div.
<div class="second common">
i am the second div.
</div>
</div>
addBomItem所在的js引入了嗎?
react-router 了解一下嗎?
應該是哪個地方用錯了,之前我也寫過。建議 直接 把每個tab的內(nèi)容分開成單獨的組件
:header-cell-style="{'text-align':'center'}"
http://jsbin.com/qubucufuya/4...
簡單寫了一下,為了方便,開始的塊,我定在了 90度的位置上,還有漸變色的處理也比較簡單,只是簡單的加色
寫這個只是為了表明 CSS是可以做到的,主要是確定位置有點麻煩,但是也是可以能過js算的
更新一下,在90度開始也是可以的,在js里判斷一下,把不要顯示的塊隱藏掉就可以了
http://jsbin.com/qubucufuya/6...
======================================更新
晚上閑來無事,又改了改,加上了 百分比顯示,只要更改render(60)函數(shù)中的數(shù)字,可以自定義百分比
http://jsbin.com/vigoxovofu/2...
setTimeout 的毫秒數(shù)設置為 0 也不會立即執(zhí)行,瀏覽器會有最小延遲,大概 5s 10s 這樣。如果頁面加載的延遲比這個延遲大就會先執(zhí)行 setTimeout
在dispatch ajax前將conent值設置為空。
這應該是最簡單的辦法了。
創(chuàng)建Application
response.data不就可以了嗎?
但我把mounted改成created的時候會報Cannot read property 'appendChild' of null"
這是因為created的時候,Dom節(jié)點還沒有渲染出來到頁面上,這個時候是找不到id=wave的DIV的。
改成Vue的插件
import wavePng from './wave.png'
export default {
install(Vue){
Vue.directive('wave', {
inserted: function(el){
start(el)
}
})
}
}
var ctx;
var waveImage;
var canvasWidth;
var canvasHeight;
var needAnimate = false;
function init (callback, wave) {
// var wave = document.getElementById('wave');
var canvas = document.createElement('canvas');
if (!canvas.getContext) return;
ctx = canvas.getContext('2d');
canvasWidth = wave.offsetWidth;
canvasHeight = wave.offsetHeight;
canvas.setAttribute('width', canvasWidth);
canvas.setAttribute('height', canvasHeight);
wave.appendChild(canvas);
waveImage = new Image();
waveImage.onload = function () {
console.log('000')
waveImage.onload = null;
callback(wave);
}
waveImage.src = wavePng;
}
function animate () {
var waveX = 0;
var waveY = 0;
var waveX_min = -203;
var waveY_max = canvasHeight * 0.7;
var requestAnimationFrame =
window.requestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (callback) { window.setTimeout(callback, 1000 / 60); };
function loop () {
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
if (!needAnimate) return;
if (waveY < waveY_max) waveY += 1.5;
if (waveX < waveX_min) waveX = 0; else waveX -= 3;
ctx.globalCompositeOperation = 'source-over';
ctx.beginPath();
ctx.arc(canvasWidth/2, canvasHeight/2, canvasHeight/2, 0, Math.PI*2, true);
ctx.closePath();
ctx.fill();
ctx.globalCompositeOperation = 'source-in';
ctx.drawImage(waveImage, waveX, canvasHeight - waveY);
requestAnimationFrame(loop);
}
loop();
}
function start (el) {
console.log(1)
if (!ctx) return init(start, el);
needAnimate = true;
setTimeout(function () {
if (needAnimate) animate();
}, 500);
}
function stop () {
needAnimate = false;
}
上述的代碼,把原先插件的閉包去掉了,因為這個改成vue的插件webpack打包完本身就是一個閉包了。
然后使用的話,就用指令的形式
<template>
<div id="wave" class="wave" v-wave><span>60%</span></div>
</template>
<script>
import wave from './a'
export default {
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.wave{width:200px;height:200px;overflow:hidden;border-radius:50%;background:rgba(255,203,103,.6);margin:100px auto;position:relative;text-align:center;display:table-cell;vertical-align:middle;}
.wave span{display:inline-block;color:#fff;font-size:20px;position:relative;z-index:2;}
.wave canvas{position:absolute;left:0;top:0;z-index:1;}
</style>
main.js
import Vue from 'vue'
import App from './App'
import router from './router'
import wave from './components/a'
Vue.config.productionTip = false
Vue.use(wave)
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})
這樣就可以了。
document.querySelectorAll('img[data-url]').forEach(item => {
item.addEventListener('click', (img) => {
document.getElementById('myvideo').src = img.getAttribute('data-url')
})
})https://blog.csdn.net/littleb... 看看這個 我試了好用
北大青鳥APTECH成立于1999年。依托北京大學優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達內(nèi)教育集團成立于2002年,是一家由留學海歸創(chuàng)辦的高端職業(yè)教育培訓機構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學校辦產(chǎn)業(yè)為響應國家深化產(chǎn)教融合/校企合作的政策,積極推進“中國制造2025”,實現(xiàn)中華民族偉大復興的升級產(chǎn)業(yè)鏈。利用北京大學優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓領域的先行者
曾工作于聯(lián)想擔任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍懿科技有限責任公司從事總經(jīng)理職務負責iOS教學及管理工作。
浪潮集團項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風格 授課風格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。