分类 笔记 下的文章

如何让{dede:channel}有子栏目显示子栏目,无子栏目不显示同级栏目

我们在使用织梦系统制作网站时经常会遇到网站栏目较多,显示当前栏目下的二级与三级栏目时,使用栏目嵌套标签,但是当三级栏目为空时,会显示同级栏目。从用户体验角度出发,常理情况下也是需要空白的,即二级栏目下的三级栏目如为空时,则不显示。那么如何让织梦{dede:channel type='son'}无子栏目时不显示同级栏目呢?

- 阅读剩余部分 -

利用sublime删除代码中所有的空行或压缩代码

作为一个web前端,一款顺手的编辑器是必不可少的,我个人是一个st的忠实粉丝,不管是界面,还是功能,还是流畅度都十分让人爱不释手。她的插件也是很多的,她的更多神奇之处我就不多讲,只要你用了你就会知道。
下面就单独说说如何利用sublime删除代码中的空行或者删除全部空格将代码压缩。

- 阅读剩余部分 -

js 判断一个字符在字符串中出现的次数

/**
 * 获取字符串s中出现re的次数
 *
 * @param      {(Function|string)}  re      正则式
 * @param      {string}             s       字符串
 * @return     {string}             出现次数
 */
function patch(re,s){
    re=eval("/"+re+"/ig"); //不区分大小写,如须则去掉i,改为 re=eval("/"+re+"/g")
    var len = s.match(re).length;
    return len;
}

方式2:
var s='jhdoiweesdds';
var n=(s.split('d')).length-1;

织梦dedecms手机搜索不跳转手机模板的解决方法

打开/plus/search.php文件,对应位置插入以下代码:

if($mobile){
    define('DEDEMOB', 'Y');
}

或:
复制plus/search.php为search_m.php,修改13行require_once(DEDEINC."/arc.searchview.classm.php");
复制include/arc.searchview.class.php为include/arc.searchview.classm.php,修改131$GLOBALS['cfg_df_style']."/search_m.htm";
即可使用search_m.php搜索

织梦DEDECMS添加栏目图片与英文名显示

一、添加字段
首先是要在数据库添加字段,英文栏目名enname,栏目图图片typelitpic,添加完后如下图
如果懒得麻烦就直接在DEDE后台或者在数据库添加SQL命令,(DEDE后台-系统-SQL命令行工具)
alter table dede_arctype add enname char(100) NOT NULL default ''; alter table dede_arctype add typelitpic char(255) NOT NULL default '';

- 阅读剩余部分 -

FlexSlider插件的详细设置参数

FlexSlider是一个非常出色的jQuery滑动切换插件,它支持所有主流浏览器,并有淡入淡出效果。适合所有初级和高级网页设计师使用。不过很多人都只是使用默认的参数,今天来说说具体的参数来给大家看看!

$(window).load(function() {
 $('.flexslider').flexslider({
  animation: "fade",              //String: Select your animation type, "fade" or "slide"图片变换方式:淡入淡出或者滑动
  slideDirection: "horizontal",   //String: Select the sliding direction, "horizontal" or "vertical"图片设置为滑动式时的滑动方向:左右或者上下
  slideshow: true,                //Boolean: Animate slider automatically 载入页面时,是否自动播放
  slideshowSpeed: 7000,           //Integer: Set the speed of the slideshow cycling, in milliseconds 自动播放速度毫秒
  animationDuration: 600,         //Integer: Set the speed of animations, in milliseconds动画淡入淡出效果延时
  directionNav: true,             //Boolean: Create navigation for previous/next navigation? (true/false)是否显示左右控制按钮
  controlNav: true,               //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage是否显示控制菜单
  keyboardNav: true,              //Boolean: Allow slider navigating via keyboard left/right keys键盘左右方向键控制图片滑动
  mousewheel: false,              //Boolean: Allow slider navigating via mousewheel鼠标滚轮控制制图片滑动
  prevText: "Previous",           //String: Set the text for the "previous" directionNav item
  nextText: "Next",               //String: Set the text for the "next" directionNav item
  pausePlay: false,               //Boolean: Create pause/play dynamic element
  pauseText: 'Pause',             //String: Set the text for the "pause" pausePlay item
  playText: 'Play',               //String: Set the text for the "play" pausePlay item
  randomize: false,               //Boolean: Randomize slide order 是否随即幻灯片
  slideToStart: 0,                //Integer: The slide that the slider should start on. Array notation (0 = first slide)初始化第一次显示图片位置
  animationLoop: true,            //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end 是否循环滚动
  pauseOnAction: true,            //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
  pauseOnHover: false,            //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
  controlsContainer: "",          //Selector: Declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken.
  manualControls: "",             //Selector: Declare custom control navigation. Example would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.自定义控制导航
  manualControlEvent:"",          //String:自定义导航控制触发事件:默认是click,可以设定hover
  start: function(){},            //Callback: function(slider) - Fires when the slider loads the first slide
  before: function(){},           //Callback: function(slider) - Fires asynchronously with each slider animation
  after: function(){},            //Callback: function(slider) - Fires after each slider animation completes
  end: function(){}               //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
  
 });
});