Question

Is it possible to link directly to a tab for a site such as http://www.antutu.com/Ranking.shtml?

I'm referring to the tabs Recommend, Highest, Lowest........

Looking at the source, I couldn't find any references of class and id in a script from the block:

<div class="tab">
<div class="tab_bg" id="mobile-tab">
<div class="fl tab_i"><a href="javascript:;"onclick="loadRanking_order(this,'mobile','df');">Recommend</a></div>
<div class="fl tab_i2"><a href="javascript:;" onclick="loadRanking_order(this,'mobile','hs');">Highest</a></div>
<div class="fl tab_i2"><a href="javascript:;" onclick="loadRanking_order(this,'mobile','ls');">Lowest</a></div>
<div class="fl tab_i2"><a href="javascript:;" onclick="loadRanking_order(this,'mobile','bv');">Cost-effective</a></div>
<div class="fl tab_i2"><a href="javascript:;" onclick="loadRanking_order(this,'mobile','be');">Experience</a></div>
<div class="fl tab_i2"><a href="javascript:;" onclick="loadRanking_order(this,'mobile','bp');">Hottest</a></div>
<div class="fl tab_i2"><a href="javascript:;" onclick="loadRanking_order(this,'mobile','bc');">Camera</a></div>
<div class="fl tab_i2"><a href="javascript:;" onclick="loadRanking_order(this,'mobile','up');">Professional</a></div>
<div class="cl"></div>
</div>
</div>

Oh and I'm really new to html and javascript, but I was using this site: http://www.dnnstuff.com/modules/aggregator-tabbed-modules/aggregator-demos/linking-directly-to-a-tab.aspx 's code as a guide.

Was it helpful?

Solution

Using an actual link to the page it wouldnt appear so.

The page runs this code when clicking on a tab

function loadRanking_order(obj, m, o) {
    $("div#" + m + "-tab div.tab_i,div#" + m + "-tab div.tab_i2").removeClass("tab_i").addClass("tab_i2");
    obj.parentNode.className = "fl tab_i"
    if (o == 'df') {
        $('#rank_' + m + '_lists').html($('#rank_' + m + '_default').html());
        return;
    }
    $.ajax({
        url: '/Ranking.shtml?cmd=ajax_' + m + '&o=' + o,
        dataType: "html",
        success: function (data) {
            $('#rank_' + m + '_lists').html(data);
        }
    });
}

You could perhaps load the page in an iframe and call the javascript method yourself

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top