Current location: Hot Scripts Forums » General Web Coding » JavaScript » Two scriptaculous highlight effects


Two scriptaculous highlight effects

Reply
  #1 (permalink)  
Old 11-21-09, 01:56 PM
mjjwatson mjjwatson is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 26
Thanks: 2
Thanked 1 Time in 1 Post
Two scriptaculous highlight effects

For some reason I can't get two highlight effects to work onload of a page, for two different divs. Lordy, can anyone help?

Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-21-09, 03:18 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
How could we possibly help?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 11-21-09, 03:34 PM
mjjwatson mjjwatson is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 26
Thanks: 2
Thanked 1 Time in 1 Post
Well at the moment I have this:

Code:
window.onload=function(){
   RecoverScroll.init();
   highlightadventure();
   
 
function highlightadventure()
{new Effect.Parallel([
  new Effect.Highlight(editedquestions), 
  new Effect.Highlight(editedquestionsa) 
], { 
  duration: 0.8,
  delay: 0.5
});

 
}
}
For some reason it doesn't work. I'd love to know why, as according to documentation it looks correct. Anyone use parallel effects with scriptalicious? Some advice would be brilliant.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 11-21-09, 04:06 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
I've not used Scriptaculous before, but the syntax looks correct.

Given that we have no idea if the [global] variables
Code:
editedquestions
and
Code:
editedquestionsa
are defined/correct at all, or if something else on the page might be overriding the window.onload event handler;
Effect.Highlight - scriptaculous - GitHub and Effect.Parallel - scriptaculous - GitHub suggests setting the 'sync' option to true on the effects so they won't run as soon as they are instantiated.
Also try to explicitly set the restorecolor option on the highlights as the script has problems reading the original background-color correctly in various browsers.
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 11-21-09, 04:31 PM
mjjwatson mjjwatson is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 26
Thanks: 2
Thanked 1 Time in 1 Post
Thanks for the reply. The function onload is running fine actually, the recoverscroll script which returns people back to the same scroll position after a _POST is active and fine. Also, single highlight effects are working fine too.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 11-22-09, 03:07 PM
mjjwatson mjjwatson is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 26
Thanks: 2
Thanked 1 Time in 1 Post
Hmmmmn now I'm thinking parallel might not be what I'm looking for. Wondering if this is for two effects on the same div?

I'm really struggling to see why this doesn't work?

Code:
window.onload=function(){
   RecoverScroll.init();
   begin();
   yo();
 
function begin()
{
  new Effect.Highlight('editedquestionsa');
  

 
}

function yo() {
	
	new Effect.Highlight('editedquestions');
}
}
This puts the highlight onto 'editedquestionsa' but not on 'editedquestions.' I'm I missing something totally noob?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! how to use transitions effects! dyablo687 Flash & ActionScript 1 11-13-09 11:10 AM
[SOLVED] Highlight Problem in Drop Down soundsofchewelah CSS 3 02-03-09 03:06 AM
PDF Search Highlight mohit Everything Java 0 11-04-08 05:40 AM
highlight html bug? <?Wille?> Hot Scripts Forum Questions, Suggestions and Feedback 1 07-11-08 03:32 AM
Mootools, JQuery, prototype, scriptaculous? Keyne JavaScript 10 06-16-08 08:10 AM


All times are GMT -5. The time now is 09:22 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.