Permalink
Browse files

update

  • Loading branch information...
1 parent 533956e commit 81ed6aec61560a737c7531fd7d3fbde972728b6a @williamjxj committed Dec 7, 2012
Showing with 68 additions and 82 deletions.
  1. +3 −10 css/f1.css
  2. +0 −37 js/jquery.fmxw4.js
  3. +20 −4 js/jquery.fmxw5.js
  4. +39 −29 templates/6/nav.tpl.html
  5. +6 −2 templates/6/ss.tpl.html
View
@@ -101,14 +101,11 @@
width:32px;
height:32px;
background:url(../images/loadPic.gif) no-repeat;
- position:absolute;
top:50%;
left:50%;
margin-top:-16px;
margin-left:-16px;
- line-height:999em;
- display:block;
- overflow:hidden;
+ position: relative;
}
.ticker-wrapper.has-js {
margin-top: 0px !important;
@@ -140,15 +137,11 @@
position:relative;
}
.hLight {
- left: 808px;
- top: 0;
- width: 58%;
- *width: 58%;
background-color: #EFF3F8;
border: 1px solid #CEDBEE;
- height: 100%;
padding: 3px;
- z-index: 10;
+ z-index: 1000;
+ position: absoulte;
display:none;
}
#smiddle .iPre {
View
@@ -68,41 +68,6 @@
attrs.src += q;
$('#sina_wb').html($('<iframe></iframe>').attr(attrs));
},
- //deprecated:
- sina_weibo_deprecated : function(q) {
- var attrs = {
- src : 'http://widget.weibo.com/livestream/listlive.php'
- };
- if ( typeof $.fmxw4.defaults === 'object')
- $.extend(attrs, $.fmxw4.defaults);
- var params = {
- language : 'zh_cn',
- width : 0,
- height : '500',
- uid : 1644057380,
- skin : 1,
- refer : 1,
- pic : 1,
- titlebar : 0,
- border : 1,
- publish : 1,
- atalk : 1,
- recomm : 0,
- at : 0,
- dpc : 1
- };
- //缁勮query瀛楃涓
- var t = '?';
- Object.keys(params).forEach(function(key) {
- t += key + '=' + params[key] + '&';
- });
- t += 'atopic=' + q;
- t += '&ptopic=' + q;
- attrs.src += t;
- $('#sina_wb').html($('<iframe></iframe>').attr(attrs));
- },
-
- //http://topic.weibo.com/areahot/5460?page=4
qq_weibo : function(q) {
var attrs = {
src : 'http://search.t.qq.com/index.php'
@@ -118,7 +83,6 @@
t += key + '=' + params[key] + '&';
});
attrs.src += t + 'k=' + q;
- //<iframe width="100%" scrolling="yes" height="500" frameborder="0" src=""></iframe>
$('#tengxun_wb').html($('<iframe></iframe>').attr(attrs));
},
@@ -129,7 +93,6 @@
$.extend(attrs, $.fmxw4.defaults);
attrs.src += q;
$('#163_wb').html($('<iframe></iframe>').attr(attrs));
- //alert($("iframe", '#163_wb').contents);
},
sohu_weibo : function(q) {
View
@@ -1,16 +1,32 @@
//参照soso的方法,来预览摘要的URL.
-(function($) {
+;(function($) {
$.fmxw5 = {
preview : function(url) {
var attrs = {
- src : UrlEncode(url)
+ src : url
};
$.extend(attrs, $.fmxw5.defaults);
- $('#preview').html($('<iframe></iframe>').attr(attrs));
+ $('#sd1').html($('<iframe></iframe>').attr(attrs));
}
};
$.fmxw5.defaults = {
+ width : '100%',
scrolling : 'yes',
+ height : 500,
frameborder : 0
};
-})(jQuery);
+})(jQuery);
+
+;(function($) {
+ $.fn.nav_preview = function(options) {
+ var defaults = {
+ scrolling : 'yes',
+ frameborder : 0
+ },
+ settings = $.extend(defaults, options),
+ f = $('<iframe></iframe>').attr(settings);
+ this.each(function() {
+ $(this).html(f).show();
+ });
+ }
+})(jQuery);
View
@@ -45,57 +45,67 @@
</ul>
<script type="text/javascript">
$(function(){
- $('span.iPre').hover(function() {
- var o = $('#sright').offset();
- var p = $('#sright').position();
- var w = $('#sright').width();
- var h = $('#sright').height();
- var t = $(this).closest('li').find('div.hLight');
+ $('span.iPre').live('mouseover', function(e) {
+ e.preventDefault();
- //alert(o.left + ', ' + o.top); //808.9000244..., 188.5
- //alert(p.left + ', ' + p.top); //769.4667..., 188.5
- //alert(w+','+h); //1065,942
- //$(t).attr({ left:808, top:0 }).show();
- //$(t).attr({ left:o.left, top:o.top, width:w, height:h }).show();
- //$(t).attr({ left:p.left, top:p.top }).show();
+ var s = $('#sright');
+ var t1 = $(this).closest('li').find('div.hLight'),
+ url = $(this).closest('li').find('a:first').attr('alt'),
+ o=s.offset(), p=s.position(), w=s.width(), h=s.height();
- //$(t).addClass('loadPic').show();
- var url = $(this).closest('li').find('a:first').attr('alt');
- console.log(url);
- var i = $('<iframe></iframe>').attr({
- scrolling: "yes",
- frameborder:0,
- src: url,
- width: "50%",
- height: "50%"
+ var pos = $(this).position();
+
+//alert($(window).height()+','+$(window).scrollTop()); //425,(221,677,1118...)
+//alert(o.left+','+o.top+','+p.left+','+p.top+','+w+','+h); //607,186,578,186,794,979
+//alert(pos.left+','+pos.top);
+
+ if (! /^http/i.test(url)) url = 'http://' + url;
+
+ var options = {
+ 'src' : url,
+ 'width' : w,
+ 'height' : h
+ };
+ $(t1).css({
+ position: "absolute",
+ top: (o.top+pos.top) + 'px',
+ left: (parseInt(o.left) - 10) + 'px'
});
- $(t).html(i);
- }, function() {
- var t = $(this).closest('li').find('div.hLight');
- if($(t).length) $(t).hide();
+ //$(t1).html('loadPic').show();
+ $(t1).html('<div class="ajaxloading"></div>').show();
+ $(t1).nav_preview(options);
+
+ e.stopPropagation();
+ });
+ $('div.hLight').live('mouseout', function(e) {
+ e.preventDefault();
+ var t2 = $(this).closest('li').find('div.hLight');
+ if($(t2).length) $(t2).hide();
+ e.stopPropagation();
});
+
{if {$sort}=='pinglun' || {$sort}==3}
$('div.comment').css('visibility', 'visible');
$('li.li3').hover(
function() {
$(this).addClass('highlight');
- $(this).find('span.iPreBox').css("visibility", "visible");
+ //$(this).find('span.iPreBox').css("visibility", "visible");
},
function() {
$(this).removeClass('highlight');
- $(this).find('span.iPreBox').css('visibility', 'hidden');
+ //$(this).find('span.iPreBox').css('visibility', 'hidden');
}
);
{else}
$('li.li3').hover(
function() {
$(this).addClass('highlight').find('div.comment').css("visibility", "visible");
- $(this).find('span.iPreBox').css("visibility", "visible");
+ //$(this).find('span.iPreBox').css("visibility", "visible");
},
function() {
$(this).removeClass('highlight').find('div.comment').css('visibility', 'hidden');
- $(this).find('span.iPreBox').css('visibility', 'hidden');
+ //$(this).find('span.iPreBox').css('visibility', 'hidden');
}
);
{/if}
View
@@ -8,6 +8,7 @@
<script type="text/javascript" src="{$config.js.easing}"></script>
<script type="text/javascript" src="include/jquery.address-1.4/jquery.address-1.4.min.js"></script>
<script type="text/javascript" src="js/jquery.fmxw1.js"></script>
+<script type="text/javascript" src="js/jquery.fmxw5.js"></script>
<!--加入fancybox-->
<!--link rel="stylesheet" type="text/css" href="include/fancybox/source/jquery.fancybox.css?v=2.1.3" media="screen" />
<script type="text/javascript" src="include/fancybox/source/jquery.fancybox.pack.js?v=2.1.3"></script-->
@@ -32,7 +33,11 @@
return false;
}).
change(function(event) {
- if(event.value=='/') return false;
+ if($('div.hLight').is(':visible'))
+ $('div.hLight').hide();
+ if(event.value=='/')
+ return false;
+
u = event.value.replace(/^\//,'');
$t = $('[rel="address:' + u + '"]');
$('{$config.wait}').insertAfter($t);
@@ -64,7 +69,6 @@
{/if}
<div class="guanggao">{include file="{$config.t}guanggao2.tpl.html"}</div>
</div>
- <div id="spreview" style="width:0;height:0;visibility:hidden"></div>
</div>
</div>
<div class="clear"></div>

0 comments on commit 81ed6ae

Please sign in to comment.