12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- /**
- * Created by Administrator on 2017/11/6.
- * 标题功能类
- */
- define([''], function () {
- var title = {
- addTitle: function (id) { //根据功能添加对应ID的标题标签
- var height = 72;
- var height2 = $('.meteo-title-box').height();
- if(height2 == 0){
- }else{
- height = height + height2/2;
- }
- var content = "<li id='meteo-title-" + id + "'></li>";
- $('#meteo-title-box').append(content);
- $('.meteo-title-box').css('top', height);
- $('.meteo-title-box').show();
- $('#meteo-title-' + id).hide();
- },
- removeTitle: function (id) { //根据功能寻找对应ID删除标签
- var height = 72;
- var height1 = $('#meteo-title-' + id).height();
- $('#meteo-title-' + id).remove();
- var height2 = $('.meteo-title-box').height();
- height = height + height2/2 - height1/2;
- $('.meteo-title-box').css('top', height);
- if ($('#meteo-title-box').children().length == 0)
- $('.meteo-title-box').hide();
- },
- updateTitle: function (id, title) {
- $('#meteo-title-' + id).html(title);
- $('#meteo-title-' + id).show();
- },
- init: function () { //初始化,准备标题存放的div
- var content = "<div class='meteo-title-box'>" +
- "<iframe frameborder='0' class='cover-iframe'></iframe>" +
- "<ul id='meteo-title-box' style='width: 285px;'></ul></div>";
- $('#standardTime').append(content);
- }
- }
- title.init();
- return title;
- })
|