代码记录(一)

window.onload = function(){
    var xia = document.getElementById(‘xia‘);
    var shang = document.getElementById(‘shang‘);
    var html = document.getElementById(‘html‘);
        xia.onclick = function(){
            slids.ent();
        }
        shang.onclick = function(){
            slids.enet();
        }
}
var slids = {
    title:["男子跑步","女子跑步","男子足球","女子足球","男子篮球","女子篮球","男子网球","女子网球","男子羽毛球","女子羽毛球","男子自行车"],
    index:0,
    ent:function(){
        var _this = this;
        _this.index++;
        _this.index = _this.index>=_this.title.length-1?_this.title.length-1:_this.index;
        //    alert(_this.index);
        html.innerHTML = _this.title[_this.index];
        return false;
    },
    enet : function(){
        var _this = this;
        _this.index--;
        _this.index = _this.index<=0?0:_this.index;
        //    alert(_this.index);
        html.innerHTML = _this.title[_this.index];
        return false;
    }
}
时间: 2024-08-30 17:53:49

代码记录(一)的相关文章

MVVM 代码记录

  一.XML <Page x:Class="MVVM.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:MVVM" xmlns:d="http://schemas

毕业设计代码记录

最近开始搞毕业论文了,亚历山大,记录一点毕业设计需要用的代码 <html>     <head>           <meta charset="utf-8">           <title>颜色插值</title>     </head>    <style>   </style> <body> <script src="http://d3js.org/d

代码记录生活-倒计时

我不会表达我的内心世界,那么我就用代码来记录我的生活,用一行行代码来表达我的心情. 虽然我写的代码都很简单,毕竟我是初学者,以后会慢慢的好的. 那么今天就先上传我昨天写的一个小计时器吧,就只有一个计时器功能,其他的没有. 源码分享地址链接:http://pan.baidu.com/s/1eQcT0A2 密码:4xru 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using

OpenCV学习代码记录——Hough线段检测

很久之前学习过一段时间的OpenCV,当时没有做什么笔记,但是代码都还在,这里把它贴出来做个记录. 代码放在码云上,地址在这里https://gitee.com/solym/OpenCVTest/tree/master/OpenCVTest #include <opencv2/core.hpp> #include <opencv2/highgui.hpp> #include <opencv2/imgproc.hpp> // http://blog.csdn.net/zh

OpenCV学习代码记录——canny边缘检测

很久之前学习过一段时间的OpenCV,当时没有做什么笔记,但是代码都还在,这里把它贴出来做个记录. 代码放在码云上,地址在这里https://gitee.com/solym/OpenCVTest/tree/master/OpenCVTest. #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> // c

OpenCV学习代码记录——轮廓(contour)检测

很久之前学习过一段时间的OpenCV,当时没有做什么笔记,但是代码都还在,这里把它贴出来做个记录. 代码放在码云上,地址在这里https://gitee.com/solym/OpenCVTest/tree/master/OpenCVTest #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> // cv

OpenCV学习代码记录—— Snake轮廓

很久之前学习过一段时间的OpenCV,当时没有做什么笔记,但是代码都还在,这里把它贴出来做个记录. 代码放在码云上,地址在这里https://gitee.com/solym/OpenCVTest/tree/master/OpenCVTest #include <opencv2/core.hpp> #include <opencv2/highgui.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/legac

OpenCV学习代码记录——人脸检测

很久之前学习过一段时间的OpenCV,当时没有做什么笔记,但是代码都还在,这里把它贴出来做个记录. 代码放在码云上,地址在这里https://gitee.com/solym/OpenCVTest/tree/master/OpenCVTest #include <opencv2/core.hpp> #include <opencv2/highgui.hpp> #include <opencv2/objdetect.hpp> #include <opencv2/img

第六章代码记录1

record_def.s 1 .equ RECORD_FIRSTNAME, 0 #记录数据:firstName:40字节 0-39 2 .equ RECORD_LASTNAME, 40 #记录数据:lastName:40字节 40-79 3 .equ RECORD_ADDRESS, 80 #记录数据:address:240字节 80-319 4 .equ RECORD_AGE, 320 #记录数据:age:4字节 320-323 5 .equ RECORD_SIZE, 324 #记录数据:siz

Unity学习笔记 之 触发Unity UI 的 Button 事件 的代码记录

首先奉献上 Button 所触发的事件 的脚本代码. 文件名为testButtonEvent using UnityEngine; using System.Collections; //1.引入 UI . using UnityEngine.UI; public class testButtonEvent : MonoBehaviour { //2.定义一个目标对象. public Text targetTextObject; // Use this for initialization vo