JQuery is used to quickly implement the AJAX dynamic loading of of instances in Tab

  • 2020-03-30 00:49:49
  • OfStack

Now I will briefly describe the implementation process:

1. Find the link source. Here is a series of links under Li

2. Style

3. When the mouse moves over, load the linked source site to the specified container, and switch the style so that the click event returns false

5. Over.

Script:


    {
    //homeNews
          var tid = "#homeNews";//removeTabBold
          var lvTabs = $(tid);
          if(lvTabs != null)
          {
            lvTabs.find("a").each(function(){$(this).click(function(){return false;});$(this).mouseover(function(){
removeTabBold(tid);$(this).addClass("bold");
$(this).parent().addClass("lvbg");
$('#HomeNewsList').load($(this).href());
return false;})});
          }
    }
    function removeTabBold(LvTabId)
    {
       $(LvTabId).find("a").each(function(){
$(this).removeClass("bold");
$(this).parent().removeClass("lvbg");
$(this).parent().parent().parent().removeClass("lvp");});
    }


Related articles: