最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

在Asp.net中使用JQuery插件之jTip代碼

 更新時(shí)間:2010年03月03日 14:03:37   作者:  
jTip 是個(gè)輕量級(jí)的提示插件。
默認(rèn)支持兩個(gè)參數(shù):
width寬度,default value :250px
link 要link的URL
對(duì)應(yīng)的Source code是:
復(fù)制代碼 代碼如下:

var params = parseQuery( queryString );
if(params['width'] === undefined){params['width'] = 250};
if(params['link'] !== undefined){
$('#' + linkId).bind('click',function(){window.location = params['link']});
$('#' + linkId).css('cursor','pointer');
}

然后我們看到初始化時(shí),是選擇所有class=jTip的<a>標(biāo)簽,然后給它們加上hover方法,讓click方法失效
復(fù)制代碼 代碼如下:

//on page load (as soon as its ready) call JT_init
$(document).ready(JT_init);
function JT_init(){
$("a.jTip")
.hover(function(){JT_show(this.href,this.id,this.name)},function(){$('#JT').remove()})
.click(function(){return false});
}

接著取得當(dāng)前id的位置計(jì)算將要顯示DIV的位置,code也不復(fù)雜:
復(fù)制代碼 代碼如下:

if(hasArea>((params['width']*1)+75)){
$("body").append("<div id='JT' style='width:"+params['width']*1+"px'><div id='JT_arrow_left'></div><div id='JT_close_left'>"+title+"</div><div id='JT_copy'><div class='JT_loader'><div></div></div>");//right side
var arrowOffset = getElementWidth(linkId) + 11;
var clickElementx = getAbsoluteLeft(linkId) + arrowOffset; //set x position
}else{
$("body").append("<div id='JT' style='width:"+params['width']*1+"px'><div id='JT_arrow_right' style='left:"+((params['width']*1)+1)+"px'></div><div id='JT_close_right'>"+title+"</div><div id='JT_copy'><div class='JT_loader'><div></div></div>");//left side
var clickElementx = getAbsoluteLeft(linkId) - ((params['width']*1) + 15); //set x position
}
$('#JT').css({left: clickElementx+"px", top: clickElementy+"px"});
$('#JT').show();
$('#JT_copy').load(url);

其它的一些help function可以參看source code,你可以從這里下載它.
如何使用呢?我們引入它與相應(yīng)的CSS:
復(fù)制代碼 代碼如下:

<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2.min.js"></script>
<script src="js/jtip.js" type="text/javascript"></script>

在asp.net webform中使用Handler,asp.net mvc 可以用action.這個(gè)用Handler演示:
復(fù)制代碼 代碼如下:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class DataHandler : IHttpHandler
{
#region Properties (1)
public bool IsReusable
{
get
{
return false;
}
}
#endregion Properties
#region Methods (2)
// Public Methods (1)
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write(GetData(Convert.ToInt32(context.Request.QueryString["id"])));
}
// Private Methods (1)
private string GetData(int key)
{
Dictionary<int, string> mydatadic = new Dictionary<int, string>();
mydatadic.Add(0, "Nothing in life is to be feared. It is only to be understood,this is id equal 0");
mydatadic.Add(1, "<strong>A man</strong> is not old as long as he is seeking something. A man is not old until regrets take the place of dreams. ,this is id equal 1");
mydatadic.Add(2, "A man can succeed at almost anything for which he has unlimited enthusiasm.,this is id equal 2");
mydatadic.Add(3, "To live is to function. That is all there is in living. ,this is id equal 3");
return mydatadic[key];
}
#endregion Methods
}

好的,在最終的HTML中這么寫(xiě):
復(fù)制代碼 代碼如下:

<span class="formInfo"><a href="DataHandler.ashx?id=0&width=375" class="jTip" id="one" name="Password must follow these rules:">?</a></span>
<br>
<p><a href="DataHandler.ashx?id=3&width=175&amp;link=http://www.google.com" name="Before You Click..." id="googleCopy" class="jTip">Go To Google</a></p>
<a href="DataHandler.ashx?id=3" class="jTip" id="three">Tip No Caption</a>

默認(rèn)是取name attribute value為Caption,上面是三種典型的link。id是我們自己傳給Handler的QueryString,最終效果如下圖所示:

jtip_1

希望這篇POST對(duì)您有幫助。

相關(guān)文章

  • ASP.NET文件上傳控件Uploadify的使用方法

    ASP.NET文件上傳控件Uploadify的使用方法

    這篇文章主要為大家詳細(xì)介紹了ASP.NET文件上傳控件Uploadify的使用方法,感興趣的小伙伴們可以參考一下
    2016-03-03
  • ASP.NET Core靜態(tài)文件的使用方法

    ASP.NET Core靜態(tài)文件的使用方法

    這篇文章主要給大家介紹了關(guān)于ASP.NET Core靜態(tài)文件的使用方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用ASP.NET Core具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-05-05
  • Could not load file or assembly "App_Licenses.dll"的問(wèn)題

    Could not load file or assembly "App_Licenses.dll"

    Could not load file or assembly "App_Licenses.dll"的問(wèn)題
    2010-03-03
  • asp.net 用戶(hù)控件讀取以及賦值

    asp.net 用戶(hù)控件讀取以及賦值

    最近項(xiàng)目中看到同事寫(xiě)的一個(gè)用戶(hù)控件,是一個(gè)下拉,值是從XML中讀取的,而且這部分還用到了LINQ讀取XML的知識(shí),最近才看了一點(diǎn)點(diǎn)LINQ的知識(shí),當(dāng)記錄一下吧。
    2009-07-07
  • 淺析.NET邏輯分層架構(gòu)

    淺析.NET邏輯分層架構(gòu)

    這篇文章主要介紹了.NET邏輯分層架構(gòu),分層架構(gòu)的三個(gè)基本層次分別為:表示層、業(yè)務(wù)邏輯層和數(shù)據(jù)訪(fǎng)問(wèn)層,感興趣的小伙伴們可以參考一下
    2015-11-11
  • Hangfire在ASP.NET CORE中的簡(jiǎn)單實(shí)現(xiàn)方法

    Hangfire在ASP.NET CORE中的簡(jiǎn)單實(shí)現(xiàn)方法

    下面小編就為大家分享一篇Hangfire在ASP.NET CORE中的簡(jiǎn)單實(shí)現(xiàn)方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2017-11-11
  • Asp.Net Core Identity 隱私數(shù)據(jù)保護(hù)的實(shí)現(xiàn)

    Asp.Net Core Identity 隱私數(shù)據(jù)保護(hù)的實(shí)現(xiàn)

    這篇文章主要介紹了Asp.Net Core Identity 隱私數(shù)據(jù)保護(hù)的實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-01-01
  • vs2017軟鏈接失效而導(dǎo)致無(wú)法進(jìn)入安裝界面的解決方法

    vs2017軟鏈接失效而導(dǎo)致無(wú)法進(jìn)入安裝界面的解決方法

    這篇文章主要為大家詳細(xì)介紹了vs2017軟鏈接失效而導(dǎo)致無(wú)法進(jìn)入安裝界面的解決方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2018-09-09
  • .Net Core部署到CentOS的圖文教程

    .Net Core部署到CentOS的圖文教程

    這篇文章主要為大家詳細(xì)介紹了.Net Core部署到CentOS的圖文教程,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2018-02-02
  • Asp.net response對(duì)象與request對(duì)象使用介紹

    Asp.net response對(duì)象與request對(duì)象使用介紹

    這篇文章主要介紹了Asp.net response對(duì)象與request對(duì)象使用,需要的朋友可以參考下
    2014-04-04

最新評(píng)論

富平县| 宁都县| 驻马店市| 融水| 南汇区| 阳城县| 阳朔县| 三门县| 台东县| 会同县| 宜州市| 温泉县| 方城县| 同心县| 高尔夫| 和静县| 哈密市| 玛沁县| 卓尼县| 北票市| 古浪县| 怀来县| 镇巴县| 茂名市| 始兴县| 厦门市| 隆德县| 田林县| 文昌市| 东城区| 宁国市| 井研县| 乐安县| 方山县| 兰溪市| 龙游县| 乳山市| 景泰县| 海林市| 禄劝| 南和县|