Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

Stop/pause header image animation after 1 full sequence?


  #1  
Old Aug 17, 2010, 09:59 PM
evster
 
5 posts · Aug 2010
Hi everyone.

Is it possible to get the header animation in the Atahualpa theme to pause it's animation on the final image available?

So, for example, if I have 5 images uploaded in the "header" folder, it will display images 1 through 5 and pause on #5 instead of repeating the cycle over and over?

I believe it's probably just a simple tweak to the script in js.php, but I am not a javascript wiz so I can't seem to figure it out.

Any help in this area would me most appreciated.

Thanks!
  #2  
Old Aug 19, 2010, 07:49 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Your idea is correct, go into the code and change the loop so it only runs once.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Aug 19, 2010, 10:30 PM
evster
 
5 posts · Aug 2010
Thanks for the tip. I've spent a lot of time working with the code in js.php, but I still can't seem to get it to work.

I assume I need to modify the code within the RotateHeaderImages() function?

I kept making changes to that function with no results, and eventually decided to delete the entire function to see what would happen and guess what - nothing changed! The images still loaded and cycled through repeatedly.

Could there be some setting within the Atahualpa theme options that is overriding my work to js.php?
  #4  
Old Aug 22, 2010, 07:20 PM
MickR
 
22 posts · May 2010
Hi evster,

Did you find a solution? Been trying the same myself and can't see where the loop is being actioned.
Would be great if you found a way round it.

Mick.
(Also wondering if it would be a useful option in ATA Header Image configuration settings in some future release).
  #5  
Old Aug 22, 2010, 07:41 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
in version 3.5.3 edit js.php and change lines 56 and 57 from
HTML Code:
			if (j > (p-1)) j=0
			t = setTimeout('RotateHeaderImages()', <?php echo $bfa_ata['header_image_javascript']; ?>000)
to
HTML Code:
			if (j < (p)) {
			t = setTimeout('RotateHeaderImages()', <?php echo $bfa_ata['header_image_javascript']; ?>000) }
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old Aug 22, 2010, 08:58 PM
MickR
 
22 posts · May 2010
Hi Juggledad,

Thanks for the reply...

I tried the change you suggested, and although it looked like it made sense it didn't actually work as expected (i.e, loop was still running). I then went in search of info relating to cross-slide and found this:

http://codingforums.com/showthread.php?t=192809

That prompted me to make a change in js.php further down (line 67?) as follows:

FROM:
.crossSlide({sleep: <?php echo $bfa_ata['header_image_javascript']; ?>,fade: <?php echo

TO:
.crossSlide({loop:1,sleep: <?php echo $bfa_ata['header_image_javascript']; ?>,fade: <?php echo

Not sure if that's a recommended way, or if there is better, but at least it worked!

Thanks,

Mick.
  #7  
Old Aug 23, 2010, 05:07 AM
MickR
 
22 posts · May 2010
Did some more testing on this one and deduced the following:

Juggledads solution works if the images are rotating with the fade in/fade out option set to '0' (i.e, no fading).

The solution i found works when the fade in/fade out option is set to 1 or above (i.e, header images fading in and out).

Basically looks like the theme calls the cross-slide function when fading required, and the loop is actioned /controlled within cross-slide using a value passed by js.php. If no fading required the loop to cycle the header images is within js.php itself.
  #8  
Old Aug 23, 2010, 05:21 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
You beat me too it, I was just going to point that out. Good work!
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #9  
Old Aug 23, 2010, 05:45 PM
evster
 
5 posts · Aug 2010
juggledad and MickR you guys seriously rock!!!

MickR I think you hit the issue I was having right on the head. I had the fade set to 2 seconds, so it was skipping that loop and nothing was happening despite my numerous changes. I added the "loop:1" bit you suggested and it worked like a charm.

Thank you so much for your help in figuring that out. I knew I was close, but like I said I'm not quite a JS master.

juggledad - I'm donating to your beer/coffee fund.
  #10  
Old Aug 23, 2010, 05:53 PM
evster
 
5 posts · Aug 2010
Also just want to throw in my 2 cents that I agree this would be a nice option built into the admin panel of future releases.

Thanks.
  #11  
Old Aug 25, 2010, 06:53 PM
MickR
 
22 posts · May 2010
Juggledad and Evster - a bit of extra info....

You may have noticed that a random header image flicks in briefly on a page load before the fading cycle starts with cross-slide. It's a bit of an annoying aspect so i've been trying to prevent it.

From what i can see bfa_header_config.php outputs the imagecontainer div and at the same time specifies a background image. I think this happens before the cross-slide function kicks in and then the background images are called again? hence the effect above.

I made the following change to bfa_header_config.php and it looks like it solved it (Line 312 onwards):

// Header Image
if ( strpos($header_items,'%image') !== FALSE ) {

ob_start();

$bfa_header_images = bfa_rotating_header_images();

if ($bfa_ata['header_image_javascript'] != "0" AND $bfa_ata['crossslide_fade'] != "0")
{echo '<div id="imagecontainer" class="header-image-container">';}

else

{echo '<div id="imagecontainer" class="header-image-container" style="background: url(' .
$bfa_header_images[array_rand($bfa_header_images)] . ') ' . $bfa_ata['headerimage_alignment'] . ' no-repeat;">';}


The change checks to see if rotating fading images are required, and if so bfa_header_config echoes the div without specifying the background image. If rotating fading images not required it outputs the theme's original code.

Hope that makes sense, and if i'm missing anything or anyone comes up with a better way let me know. Maybe also an area to add to Flynns bug list?
  #12  
Old Aug 31, 2010, 12:50 PM
evster
 
5 posts · Aug 2010
Thanks MickR!

I did indeed notice that annoying image flick problem. I don't like it but so far I've been willing to live with it because I wasn't sure how to fix it on my own.

I will try out your solution and see how it goes.
  #13  
Old Sep 5, 2010, 07:22 AM
Sven
 
32 posts · Aug 2009
New Hamphire, USA
Well, I was going to reply, but the forum timed me out so i shall not.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Image Mosaic, full page, linkable manuhoz Center area post/pages 3 Jul 30, 2010 10:50 AM
3.5.1: Header images always rotate in the same sequence... not great! cfibanez Header configuration & styling 4 Jul 26, 2010 08:34 AM
background image over-sized - Full Page Background Image prokopino Atahualpa 3 Wordpress theme 2 Mar 30, 2010 05:42 AM
page sequence wereldbol Page & Category Menu Bars 4 Jan 17, 2010 10:21 AM
[SOLVED] Page menu bar gif image full width rcarbaugh Page & Category Menu Bars 4 Jan 13, 2010 01:43 PM


All times are GMT -6. The time now is 10:26 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.