Non-wrappable / wrappable label based on Layer : Label « Ajax Layer « JavaScript DHTML

Home
JavaScript DHTML
1.Ajax Layer
2.Data Type
3.Date Time
4.Development
5.Document
6.Dojo toolkit
7.Event
8.Event onMethod
9.Ext JS
10.Form Control
11.GUI Components
12.HTML
13.Javascript Collections
14.Javascript Objects
15.Javascript Properties
16.jQuery
17.Language Basics
18.Mochkit
19.Mootools
20.Node Operation
21.Object Oriented
22.Page Components
23.Rico
24.Scriptaculous
25.Security
26.SmartClient
27.Style Layout
28.Table
29.Utilities
30.Window Browser
31.YUI Library
JavaScript DHTML » Ajax Layer » Label 
Non-wrappable / wrappable label based on Layer


http://dynapi.sourceforge.net/
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
<html>
<head>
<title>DynAPI Examples - Label</title>
<script language="JavaScript" src="./dynapisrc/dynapi.js"></script>
<script language="JavaScript">
dynapi.library.setPath('./dynapisrc/')
dynapi.library.include('dynapi.api')
dynapi.library.include('dynapi.gui.Label')
</script>
<script language="JavaScript">
  label1 = new Label('');
  label1.setText('this is a padded wrappable label');
  label1.setWrap(true);
  label1.setLocation(350,20)
  label1.setBgColor('yellow')
  label1.setPadding(5)
  label1.setWidth(100)
  label1.packHeight()
  dynapi.document.addChild(label1)

  label2 = new Label()
  label2.setText('this is a non-selectable wrappable label')
  label2.setWrap(true)
  label2.setLocation(350,110)
  label2.setBgColor('yellow')
  label2.setWidth(100)
  label2.packHeight()
  label2.setSelectable(false)
  dynapi.document.addChild(label2)

  label3 = new Label('this is a padded non-wrappable label')
  label3.setLocation(350,220)
  label3.setBgColor('yellow')
  label3.setPadding(8)
  label3.pack()
  dynapi.document.addChild(label3)

  label4 = new Label('this is a non-selectable non-wrappable label')
  label4.setLocation(350,280)
  label4.setBgColor('yellow')
  label4.pack()
  label4.setSelectable(false)
  dynapi.document.addChild(label4)

//-->
</script>
</head>
<body bgcolor="#ffffff">
<script language="JavaScript">
    dynapi.document.insertAllChildren();
</script>
Resize:
<br>wrappable label: <a href="javascript:label1.setWidth(100)">100</a>, <a href="javascript:label1.setWidth(170)">170</a>
<br>wrappable label with cover: <a href="javascript:label2.setWidth(80)">80</a>, <a href="javascript:label2.setWidth(150)">150</a>
<br>non-wrappable label: <a href="javascript:label3.setWidth(80)">80</a>, <a href="javascript:label3.setWidth(150)">150</a>
<br>non-wrappable label with cover: <a href="javascript:label4.setWidth(80)">80</a>

</body>
</html>

           
       
dynapi.zip( 791 k)
Related examples in the same category
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.