Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Change size of div... but not text

Expand Messages
  • Matt Sweeney
    Hi Denis, Setting the animated element s overflow to hidden should give you the desired effect. Matt
    Message 1 of 2 , Sep 5, 2006
    • 0 Attachment
      Hi Denis,

      Setting the animated element's overflow to "hidden" should give you the
      desired effect.

      Matt

      Denis wrote:

      >I've got some divs that can have different heights. I would like that
      >when click a, for example. collapse link those divs become all set to
      >height 100px... but what is very important is text. I would like that
      >in some way text becomes cut at that specific height.
      >
      >I tried with Animation... following you can see the code:
      >
      >...
      ><script type="text/javascript">
      >YAHOO.example.init = function() {
      > var attributes = {
      > //width: {to: 100},
      > height: {to: 100},
      > //fontSize: {from: 100, to: 50, unit: '%'},
      > //opacity: { to: 0.5 }
      > };
      >
      > var anim = new YAHOO.util.Anim('demo', { height: {to: 100} });
      > YAHOO.util.Event.on(document, 'click', anim.animate, anim, true);
      >};
      >
      >YAHOO.util.Event.onAvailable('demo', YAHOO.example.init);
      ></script>
      ></head>
      ><body id="animation-demo-size-plus">
      ><div id="doc">
      > <h1>Animation Example - Size Plus Other Attributes</h1>
      > <p>This example demonstrates how to animate an element's size,
      >fontSize, and opacity to given values.</p>
      > <p>Click anywhere to start animation.</p>
      > <div id="demo">Lorem ipsum dolor sit amet, consectetuer adipiscing
      >elit. Cras at ipsum quis est aliquet dignissim. Praesent luctus, pede
      >et laoreet laoreet, arcu odio ullamcorper mauris, sed semper elit nisi
      >in sem. Cum sociis natoque penatibus et magnis dis parturient montes,
      >nascetur ridiculus mus.</div>
      >...
      >
      >But when I click on div... div becomes smaller but text goes outside div.
      >
      >Can you help me?
      >
      >
      >
      >
      >
      >
      >
      >Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.