当我尝试在此image
上给出的菜单顶部中从左向右或其他方式滚动时这里的问题是,在移动设备中它不会那样工作点击它后滚动到其他地方但在网络中它完美地工作我已经完成的HTML在下面给出
<div id="Default" class="contentHolder">
<div class="content cd-tabs-navigation">
<ul>
<li><a data-content="HousingVitals" id="HousingVitals1" onclick="scrollDefault(1);" href="#0">Housing Vitals</a></li>
<li><a data-content="Score" id="Score1" class="selected" onclick="scrollDefault(2);" href="#0">Rating Snapshot</a></li>
<li><a data-content="locality" id="locality1" onclick="scrollDefault(3);" href="#0">Housing v/s Locality</a></li>
<li><a data-content="Indicators" id="Indicators1" onclick="scrollDefault(4);" href="#0">Top Indicators</a></li>
<li><a data-content="Compare" id="Compare1" onclick="initialize();" href="#0">Nearby Housings</a></li> @*onclick="scrollUpMenu('near')"*@
<li><a id="liInsights" data-content="Insights" onclick="scrollDefault(6);" href="#0">Key Insights</a></li>
<li><a id="liDetailscore" data-content="Detailscore" onclick="scrollDefault(7);" href="#0">Detailed Rating</a></li>
<li><a data-content="Wisometer" id="Wisometer1" onclick="scrollDefault(8);" href="#0">Wiso Meter</a></li>
</ul>
</div>
</div>
和java脚本代码在下面给出
function scrollDefault(x)
{
if(x == 1)
{
$('#Default').scrollLeft(0);
}
else if(x == 2)
{
$('#Default').scrollLeft(50);
}
else if(x == 3)
{
$('#Default').scrollLeft(130);
}
else if(x == 4)
{
$('#Default').scrollLeft(220);
}
else if(x == 5)
{
$('#Default').scrollLeft(300);
}
else if(x == 6)
{
$('#Default').scrollLeft(370);
}
else if(x == 7)
{
$('#Default').scrollLeft(420);
}
else if(x == 8)
{
$('#Default').scrollLeft(500);
}
}