Hello JQuery group,

I'm must say that I really enjoy using the jquery.expander control for
a simple and intuitive UI.  It works really well with news items that
need to include a Read More... and Close... option.

I just have a strange issue/artifact with one of the controls
properties, the userCollapseText property.  The strange thing about
this issue is that I'm using the control on a test repeater which
works fine (I'll explain in a bit) but on our test box in a DIFFERENT
repeater, it somehow creates duplicated Close links when the item is
expanded.

Please note that both test apps are using version 1.4.1 of the JQuery
javascript library and version 0.4 of the JQuery extender plugin.

The first example is as follows (note the expandText and
userCollapseText are populated in the code-behind, this is an ASP.NET
app):

<head runat="server">
  <title>Untitled Page</title>
  <script src="/js/jquery.js" type="text/javascript"></script>
  <script src="/js/jquery.expander.js" type="text/javascript"></
script>

  <script type="text/javascript">
  $(document).ready(function() {

       // override some default options
       $('p').expander({
            slicePoint:       80,               // default is 100
            expandText:       '<%= GetExpandText %>',   // default is
'read more...'
            expandEffect: 'show',
            userCollapseText: '<%= GetCollapseText %>'          // default is
'[collapse expanded text]'
       });

  });
  </script>
</head>

<body>
    <form id="form1" runat="server">
    <div>
    <asp:Repeater ID="ExpanderTestRepeater" runat="server">
      <ItemTemplate>
        <p style="width: 350px">
          <%# DataBinder.Eval(Container.DataItem,"Value") %>
          </p>
       </ItemTemplate>
    </asp:Repeater>
    </div>
    </form>
</body>

This works just fine as here are the copied results of a closed/
expanded item:

Contrary to popular belief, Lorem Ipsum is not simply random text. It
has roots …
Read More...

Contrary to popular belief, Lorem Ipsum is not simply random text. It
has roots in a piece of classical Latin literature from 45 BC, making
it over 2000 years old.
^ Close...

(There are three items in this repeater and they all work perfectly!)

The issue is with the test apps on our testing box:

The script code is basically the same:

<script src="/js/jquery.js" type="text/javascript"></script>
<script src="/js/jquery.expander.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function() {

    // override some default options
    $('p.BodyMarker').expander({
        slicePoint:       80,                           // default is
100
        expandText:       '<br />Read More...',         // default is 'read
more...'
        expandEffect:     'show',
        userCollapseText: '<br />^ Close'               // default is
'[collapse expanded text]'
    });

});
</script>

As well as the repeater:

<asp:Repeater ID="rptNews" runat="server">
  <ItemTemplate>
    <p class="title">
      <span class="date">
        <asp:Label runat="server" ID="lblNewsTime" Text=<%#
DateTime.Parse(Eval("Date").ToString()).ToString("MM.dd.yyyy")%>></
asp:Label>
      </span>
      <asp:Label  runat="server" ID="lblTitle" Text=<%# Eval("Title")
%>></asp:Label>
    </p>
    <p class="BodyMarker">
      <asp:Literal  runat="server" ID="ltrContent" Text=<%#
Eval("Body")%>></asp:Literal><br />
    </p>
    <div id="newsdivider"></div>
  </ItemTemplate>
</asp:Repeater>

Unfortunately the output yeilds a duplicated ^ Close link:

01.21.2010COGNEX OFFERS NEW VISION TOOLS FOR SOLAR CELL INSPECTION

Cognex Corporation (NASDAQ: CGNX) has further expanded its range of
inspection …
Read More...

01.21.2010COGNEX OFFERS NEW VISION TOOLS FOR SOLAR CELL INSPECTION

Cognex Corporation (NASDAQ: CGNX) has further expanded its range of
inspection …
Read More...solutions for solar cell manufacturing processes. The new
VisionPro® Solar Toolbox includes pre-configured software tools for
the most common vision alignment and inspection applications in
photovoltaic (PV) solar production. With the addition of the Solar
Toolbox, users have the option of working either with the basic
VisionPro software library, or using the pre-configured tool set as a
starting point for setting up vision inspection and alignment
applications. VisionPro software’s industry-leading tools for
location, identification, and inspection can also be leveraged
throughout the value chain to help manufacturers achieve higher
quality, faster throughput, and better process control.

^ Close
^ Close

If you have any suggestions as to what I may be doing wrong, please
let me know at your earliest convenience.

Thanks very  much in advance for your time!

Jason Priddy
jason.r.pri...@gmail.com

Reply via email to