Source language: Translate to:

highlight text

General questions about NeoAppBuilder - our rapid application development tool for building HTML5, web and mobile apps.

Moderator: Neosoft Support

highlight text

Postby farhad2008 » Wed Jun 01, 2016 11:03 am

hi,
how do highlight line or word in container text document ?
what is javascript function for it?

thanks
farahd
The Words I Love You
farhad2008
 
Posts: 48
Joined: Tue Apr 01, 2008 1:15 am
Location: usa

Re: highlight text

Postby Gaev » Wed Jun 01, 2016 11:55 am

farhad2008:
how do highlight line or word in container text document ?

I assume you want a word or phrase to have a yellow (or other colored) background ?

what is javascript function for it?

Javascript is not the tool for doing rich text (like layout, bold, underline, etc.) ... html (< span>....< /span>) and css (add class or property for background color) should be used.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: highlight text

Postby farhad2008 » Thu Jun 02, 2016 10:21 am

"I assume you want a word or phrase to have a yellow (or other colored) background ?"


yes i need highlight line by line in sequential of time

thanks
The Words I Love You
farhad2008
 
Posts: 48
Joined: Tue Apr 01, 2008 1:15 am
Location: usa

Re: highlight text

Postby Neosoft Support » Thu Jun 02, 2016 6:02 pm

NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: highlight text

Postby luishp » Fri Jun 03, 2016 4:17 am

Just use some CSS and JavaScript this way:

1) Add HTML to your container and be sure to assign an "id" to each line of text. You can use the <span> tag:

Code: Select all
<span id="p1">Line one</span><br>
<span id="p2">Line two</span><br>
<span id="p3">Line three</span><br>
<span id="p4">Line four</span><br>
<span id="p5">Line five</span><br>
<span id="p6">Line six</span><br>
<span id="p7">Line seven</span>


2) Add a button, double click it and add this code to highlight the first line:

Code: Select all
BeginJS
   $("#p1").css("background","red");
EndJS


Or add this code to highlight every single line with 1000 milliseconds delay between them:

Code: Select all
BeginJS
   $("#p1").css("background","red");
EndJS

Wait 1000
BeginJS
   $("#p2").css("background","red");
EndJS
EndWait

Wait 2000
BeginJS
   $("#p3").css("background","red");
EndJS
EndWait

Wait 3000
BeginJS
   $("#p4").css("background","red");
EndJS
EndWait

Wait 4000
BeginJS
   $("#p5").css("background","red");
EndJS
EndWait

Wait 5000
BeginJS
   $("#p6").css("background","red");
EndJS
EndWait

Wait 6000
BeginJS
   $("#p7").css("background","red");
EndJS
EndWait
Luis Hernández - SinLios Soluciones Digitales
http://sinlios.com
User avatar
luishp
 
Posts: 357
Joined: Wed May 23, 2007 10:17 am
Location: Spain

Re: highlight text

Postby farhad2008 » Fri Jun 03, 2016 11:03 am

hi,
very good luishp
thank you it is work in your sample but in the normal html page is not work
thanks
The Words I Love You
farhad2008
 
Posts: 48
Joined: Tue Apr 01, 2008 1:15 am
Location: usa


Return to General NeoAppBuilder Discussion

Who is online

Users browsing this forum: No registered users and 0 guests