在scene外面
<action name="do_crop_animation">
<!-- 为热点注册属性 -->
registerattribute(xframes, calc((imagewidth / %1) BOR 0));
registerattribute(yframes, calc((imageheight / %2) BOR 0));
registerattribute(frames, calc(xframes * yframes));
registerattribute(frame, 0);
set(...阅读全文>>
然后在tour.xml的scene标签外面书写:
<events name="littleplanetintro_control" keep="true"
onnewpano="
if(scene[get(xml.scene)].index == 0 OR scene[get(xml.scene)].index == 4,
skin_setup_littleplanetintro()
)"
/>
第0个场景或者第4个场景实现小行星;
或者littleplanetintro="true"
...阅读全文>>
Object.defineProperty(this , 'navigator' , {value: { platform: "" }})
或ie
Object.defineProperty(navigator,'platform',{get:function(){return '';}});阅读全文>>
var fs = require("fs");
var data = '';
// 创建可读流
var readerStream = fs.createReadStream('input.txt');
// 设置编码为 utf8。
readerStream.setEncoding('UTF8');
// 处理流事件 --> data, end, and error
readerStream.on('data', function(chunk) {
data += chunk;
});
readerStream.on('end',function(...阅读全文>>
var fs = require("fs");
var data = '12121';
// 创建一个可以写入的流,写入到文件 output.txt 中
var writerStream = fs.createWriteStream('output.txt');
// 使用 utf8 编码写入数据
writerStream.write(data,'UTF8');
// 标记文件末尾
writerStream.end();
// 处理流事件 --> data, end, and error
writerStream.on('finish', functio...阅读全文>>
var fs=require("fs");
var zlib=require("zlib");
// fs.createReadStream("1.txt").pipe(zlib.createGzip()).pipe(fs.createWriteStream("1.txt.gz"));//压缩
fs.createReadStream("1.txt.gz").pipe(zlib.createGunzip()).pipe(fs.createWriteStream("1.txt"));//解压
console.log("ok");阅读全文>>
今天又遇到了需要跨静态页面间传递json数据的方法,总结总结,都有其优缺点,
1.利用cookie传值的方法:(注意有缺点,当存储数据比较多的时候就可能出现丢失,取得的cookie为空,所以提前估量数据量)
function setCookie(c_name, value, expiredays) {
var exdate = new Date() ;
exdate.setDate(exdate.getDate() + expiredays);
document.cookie = c_name + "=" + escape(value) ...阅读全文>>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>iframe tag test</title>
<style type="text/css">
html, body
...阅读全文>>
html内容:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
<script src="js/mui.min.js"...阅读全文>>
watch:{
$route(to,from){
// to.path这个为路径
if(to.path=="home"){
this.$store.dispatch("aa");//aa为方法名
}
alert("路由change");
}
}阅读全文>>