yii1.1各版本都存在此问题
activate(href)修改为activate('>ul a[href="'+href+'"]');
activate(id)修改为activate('>ul a[href="'+id+'"]');
修改后如下
/**
* jQuery Yii plugin file.
*
* @author Qiang Xue <qiang.xue@gmail.com>,代码之美<haohetao@gmail.com>
* @link http://www.yiiframework.com/
* @copyright 2008-2013 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
(function($) {
$.extend($.fn, {
yiitab: function() {
function activate(id) {
var pos = id.indexOf("#");
if (pos>=0) {
id = id.substring(pos);
}
var $tab=$(id);
var $container=$tab.parent();
$container.find('>ul a').removeClass('active');
$container.find('>ul a[href="'+id+'"]').addClass('active');
$container.children('div').hide();
$tab.show();
}
this.find('>ul a').click(function(event) {
var href=$(this).attr('href');
var pos=href.indexOf('#');
activate('>ul a[href="'+href+'"]');
if(pos==0 || (pos>0 && (window.location.pathname=='' || window.location.pathname==href.substring(0,pos))))
return false;
});
// activate a tab based on the current anchor
var url = decodeURI(window.location);
var pos = url.indexOf("#");
if (pos >= 0) {
var id = url.substring(pos);
if (this.find('>ul a[href="'+id+'"]').length > 0) {
activate('>ul a[href="'+id+'"]');
return;
}
}
}
});
})(jQuery);
上面的解决方案是不恰当的,后来发现了新的解决方案
不需要修改js,而是把tagid作为anchor放到url中,就是url#id的形式
比如
$tabParameters[$tab]=['title'=>$title,'url'=>$this->createUrl('index',['selTab'=>$tab,'#'=>$tab])];
相关推荐
Packtpub.Agile.Web.Application.Development.with.Yii1.1.and.PHP5.Aug.2010.rar
Agile.Web.Application.Development.with.Yii1.1.and.PHP5
(完整版)Yii.1.1.Application.Development.Cookbook.Aug.2011
非常流行的Yii php框架
yii-docs-1.1.17.467ff50
Yii 1.1 Application Development Cookbook
yiren-p8Yii-v17323.apk
Ajax-yii2-widgets.zip,yii2框架的小部件集合,ajax代表异步javascript和xml。它是多种web技术的集合,包括html、css、json、xml和javascript。它用于创建动态网页,其中网页的小部分在不重新加载网页的情况下更改。
Yii 框架 php编程框架 MVC 十分简洁方便的开发框架
Yii1.1程序开发实例
[Packt Publishing] Yii 1.1 应用开发经典实例 (英文版) [Packt Publishing] Yii 1.1 Application Development Cookbook (E-Book) ☆ 出版信息:☆ [作者信息] Alexander Makarov [出版机构] Packt Publishing ...
Agile Web Application Development with Yii 1.1 and PHP5.rar 大小: 7797314 字节 修改时间: 2010年8月29日, 14:52:41 MD5: BF7D679B091DA3D58111BF8A58F5067C SHA1: 4C499FC65D253113E50442105CFB6DD7E9DFB30B ...
Yii 1.1应用程序开发实例最终版,中文版本,非扫描版,带书签。
很好的工具书和代码 yii1.1_application_development_cookbook_code.zip ,适用于yii和php学习
应用yii1.1和php5进行敏捷web开发.chm--中文版
YII 1.1 Application Development Cookbook