Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> JavaScript
Author Message
killing-hours
RavenNuke(tm) Development Team



Joined: Oct 01, 2010
Posts: 438
Location: Houston, Tx

PostPosted: Fri Nov 05, 2010 8:07 am Reply with quote

Hey all-

Just a simple question this time. I'm adding a jquery contact form to my site but I want it to follow the user across all pages... which file(s) do I need to be looking at to accomplish this.

(similar to how nuken has the social bar following users across his/her site)

Thanks!

_________________
Money is the measurement of time - Me
"You can all go to hell…I’m going to Texas" -Davy Crockett 
View user's profile Send private message
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Fri Nov 05, 2010 8:40 am Reply with quote

I might suggest something like the tab slideout plugin
http://wpaoli.building58.com/2009/09/jquery-tab-slide-out-plugin/

there are a ton of these available, this one has worked for me in the past. If I remember right you can position it top,bottom,left, or right.. you'll just want to create a includes/addons/head-anynamehere.php to call your script/css and place your form in the hidden div as per his instructions Smile
 
View user's profile Send private message Visit poster's website
killing-hours







PostPosted: Fri Nov 05, 2010 8:50 am Reply with quote

Perfect!! I looked around and found a similar one but I'm having all sorts of issues trying to position it to the right like they have done on the left. Thanks for the link and answer!!!
 
killing-hours







PostPosted: Fri Nov 05, 2010 11:57 am Reply with quote

Spastic-

When I do it this way... for a split second the hidden div shows above the header then disappears. To me this is no big issue as it's only there for about a second.. but some of my end users run slower machines and it may actually be on the screen longer than a second on their side.

Is there a way to either load it after the page is done rendering or preload it somehow? Thanks.

--------

I noticed nuken's social bar is delayed from showing on the screen for a few seconds so this "should" be a possibility somehow. Ohhhh nuken... where are you? Wink
 
spasticdonkey







PostPosted: Fri Nov 05, 2010 12:23 pm Reply with quote

not sure how your including the form and hidden div, but for mine I added it to the footer function of my theme. Never seen it flash on the screen but not sure I could scroll down fast enough if i tried Smile

you could also try adding the form to admin - preferences in one of the footers, if the editor doesn't mangle your code too much Wink

but basically, try loading the form later in the page.

also, as i think about this I'm pretty sure I had to place the slideout div inside a hidden div, not hide the slideout div. something like

<div style="display:none;">
<div class="slide-out-div">CONTENT_HERE</div>
</div>


not
<div class="slide-out-div" style="display:none;">CONTENT_HERE</div>
 
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Fri Nov 05, 2010 12:38 pm Reply with quote

You're right spastic, use display:none.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
killing-hours







PostPosted: Fri Nov 05, 2010 12:38 pm Reply with quote

Gotcha... I'll give that a try. Basically what i've done is add this code to the head-mine.php

Code:
<?php


$contactcss = '<style>
     
      .slide-out-div {
          padding: 20px;
          width: 250px;
          background: #5a83a1;
          border: #29216d 1px solid;
        z-index: 1;
      }     
      </style>';
addCSSToHead($contactcss, 'inline');

addJSToHead('includes/jquery/jquery.tabSlideOut.v1.3.js', 'file');
$contact = '<script>
         $(function(){
             $(".slide-out-div").tabSlideOut({
                 tabHandle: ".handle",                              //class of the element that will be your tab
                 pathToTabImage: "images/contact_tab.gif",          //path to the image for the tab (optionaly can be set using css)
                 imageHeight: "122px",                               //height of tab image
                 imageWidth: "40px",                               //width of tab image   
                 tabLocation: "right",                               //side of screen where tab lives, top, right, bottom, or left
                 speed: 300,                                        //speed of animation
                 action: "click",                                   //options: "click" or "hover", action to trigger animation
                 topPos: "200px",                                   //position from the top
                 fixedPosition: false,                               //options: true makes it stick(fixed position) on scroll
          });
         });

</script>';
addJSToHead($contact , 'inline');

echo '<div class="slide-out-div">
        <a class="handle" href="">Contact Us</a>
        <h3>Contact Us</h3>
        <br />
        <p>Coming soon... Slide out contact form!</p>
    </div>';

?>


Guess I could take the comments out but w/e for the moment. Wink

The reason I believe it's showing for that second is due to RN loading the addons first then the rest of the site. I guess I could add this code to the footer.php as a last resort. Thanks for the tips!!

---------

Edit***

Thanks for confirming nuken.
 
killing-hours







PostPosted: Fri Nov 05, 2010 12:54 pm Reply with quote

Ok.... tried adding the sytle=none (shortened) and it hid the entire thing... so that didn't seem to work right unless I'm misunderstanding it.

Code:
echo '<div style="display:none;">

       <div class="slide-out-div">
        <a class="handle" href="">Contact Us</a>
        <h3>Contact Us</h3>
        <br />
        <p>Coming soon... Slide out contact form!</p>
    </div>
   </div>';


tried with & without the semi colon behind "none".

---------------------------

Edit***

Also tried adding the code to the footer.php but couldn't get it to work correctly, and because I'm playing with this on a "live" site ATM, I don't really want to fool with it to much testing different things within the footer. Thanks for y'alls help.
 
nuken







PostPosted: Fri Nov 05, 2010 1:24 pm Reply with quote

Try using it in the p

Code:


<p style="display:none;">Coming soon... Slide out contact form!</p>



Never mind. that will just hide your text.
 
spasticdonkey







PostPosted: Fri Nov 05, 2010 1:39 pm Reply with quote

you can't echo out content for the page from within one of the includes/addons/head-xyz.php files, as it is processed before the opening body tag of the webpage. i.e.

Code:
echo '<div class="slide-out-div">

        <a class="handle" href="">Contact Us</a>
        <h3>Contact Us</h3>
        <br />
        <p>Coming soon... Slide out contact form!</p>
    </div>';


that's why you are seeing it at the top of the page. echo that content somewhere before the closing </body> tag and not from within the addons. Since you want site wide getting it in the footer is probably best. try adding to
themes/YOUR_THEME/theme.php - function themefooter
or if your theme uses a template for the footer you can add it there

OR you can create includes/custom_files/custom_footer.php
(not recommended for content that is displayed inline but since you won't be displaying it there..)

so wherever you put it, you will want
Code:
echo '<div style="display:none;"><div class="slide-out-div">

        <a class="handle" href="">Contact Us</a>
        <h3>Contact Us</h3>
        <br />
        <p>Coming soon... Slide out contact form!</p>
    </div></div>';
 
killing-hours







PostPosted: Fri Nov 05, 2010 1:46 pm Reply with quote

spasticdonkey wrote:
you can't echo out content for the page from within one of the includes/addons/head-xyz.php files, as it is processed before the opening body tag of the webpage. i.e.

Code:
echo '<div class="slide-out-div">

        <a class="handle" href="">Contact Us</a>
        <h3>Contact Us</h3>
        <br />
        <p>Coming soon... Slide out contact form!</p>
    </div>';


that's why you are seeing it at the top of the page. echo that content somewhere before the closing </body> tag and not from within the addons. Since you want site wide getting it in the footer is probably best. try adding to
themes/YOUR_THEME/theme.php - function themefooter
or if your theme uses a template for the footer you can add it there

OR you can create includes/custom_files/custom_footer.php
(not recommended for content that is displayed inline but since you won't be displaying it there..)

so wherever you put it, you will want
Code:
echo '<div style="display:none;"><div class="slide-out-div">

        <a class="handle" href="">Contact Us</a>
        <h3>Contact Us</h3>
        <br />
        <p>Coming soon... Slide out contact form!</p>
    </div></div>';



Now this makes sense to me. I'll give this one a go round. Thanks for the info!

------------

Edit***

Works like a charm!! Learn something new everyday. Thanks bud.
 
fernades
New Member
New Member



Joined: Aug 18, 2010
Posts: 21

PostPosted: Mon Apr 11, 2011 5:11 am Reply with quote

Good post!
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> JavaScript

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©