来自另一个页面的JQuery编辑页面

时间:2014-09-26 12:03:33

标签: javascript jquery html

我正在使用jquery mobile,我有两个页面都使用data-role="page"

现在从第1页开始,我有一个项目列表(下面的代码),根据用户选择的内容,我希望它们显示在第2页。这可能吗?

HTML

<div class="FirstHomeMenuRow" style="position: absolute;left:0px;">
    <div class="firstIconleft" style="height:50%;width:16%;">
        <a href="SchoolMaterials.html">
            <img src="images/schoolmaterial.png" alt="find school materials" style="margin-left:10px;width:100%"/>
        </a>
        <div class="captionHomeIcon" style="margin-left: -2% !important;margin-top:0%;">find school materials</div>
    </div>
    <div class="firstIconleft" style="margin-right:20px !important;height:50%;width:16%;">
        <a href="UseApp.html">
            <img src="images/UseApp.png" alt="find school materials" style="width:100%;"/>
        </a>
        <div class="captionHomeIcon" style="margin-left: 1% !important;margin-top:0%;">use an app</div>
    </div>
    <div class="firstIconright" style="margin-right:20px !important;height:50%;width:16%;padding-right:6%;">
        <a href="ReadWrite.html">
            <img src="images/readwrite.png" alt="find school materials" style="width:100%;"/>
        </a>
        <div class="captionHomeIcon" style="margin-left:-3% !important;margin-top:0%;">read/write to me</div>
    </div>
</div>
<div class="SecondHomeMenuRow" style="position: absolute;left:0px;bottom:12%;">
    <div class="firstIconleft" style="margin-right: 15% !important;width:16%;">
        <a href="SeeWhatHappened.html"> 
            <img src="images/GoOverDay.png" alt="find school materials" style="width:100%;padding-left:20%;"/>
        </a>
        <div class="captionHomeIcon" style="margin-left:1.5%;margin-top:0%;">go over my day</div>
    </div>
    <div class="firstIconleft" style="margin-right:10px !important;width:16%;">
        <a href="SendMessage.html">
            <img src="images/sendMessage.png" alt="find school materials" style="width:100%;padding-left:20%;"/>
        </a>
        <div class="captionHomeIcon"  style="margin-left:1.5%;margin-top:0%;">send a message</div>
    </div>
    <div class="firstIconright"style="margin-right: 20% !important;width:16%;">
       <a href="HelpRead.html">
           <img src="images/helpRead.png" alt="find school materials" style="width:100%;padding-left:14%;"/>
       </a>
       <div class="captionHomeIcon" style="margin-right:59px;margin-left:1.5%;margin-top:0%;">help me read</div>
    </div>
</div>
<ul id="FavListApp">
   <li style="margin-bottom:20px;"><a href="#">Dragon App</a></li>
   <li style="margin-bottom:20px;"><a href="#">Calculator</a></li>
   <li style="margin-bottom:20px;"><a href="#">Brain Academy</a></li>
   <li style="margin-bottom:20px;"><a href="#">Root Words</a></li>
</ul>

JQuery的

var sel = 'url(images/FavStarSel.png)';
var unsel = 'url(images/FavStarUnSel.png)';

$('#FavListApp li > a').on("click",function (e) {
   e.preventDefault();
   $link = $(this);
   $link.toggleClass("selected");
   $link.parent().css('listStyleImage', $link.hasClass("selected")?unsel:sel);
});

0 个答案:

没有答案