Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

smarty tooltip

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
hassan68
Smarty Rookie


Joined: 27 Apr 2011
Posts: 21

PostPosted: Sun Mar 18, 2012 4:57 pm    Post subject: smarty tooltip Reply with quote

i want to use a tooltip for my site
and i have some javascript code
Code:

 {literal}
  <script type="text/javascript">
    <!--
 
    $(function () {
        $('.bubbleInfo').each(function () {
            var distance = 10;
            var time = 250;
            var hideDelay = 500;
 
            var hideDelayTimer = null;
 
            var beingShown = false;
            var shown = false;
            var trigger = $('.trigger', this);
            var info = $('.popup', this).css('opacity', 0);
 
 
            $([trigger.get(0), info.get(0)]).mouseover(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                if (beingShown || shown) {
                    // don't trigger the animation again
                    return;
                } else {
                    // reset position of info box
                    beingShown = true;
 
                    info.css({
                        top: -90,
                        left: -33,
                        display: 'block'
                    }).animate({
                        top: '-=' + distance + 'px',
                        opacity: 1
                    }, time, 'swing', function() {
                        beingShown = false;
                        shown = true;
                    });
                }
 
                return false;
            }).mouseout(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                hideDelayTimer = setTimeout(function () {
                    hideDelayTimer = null;
                    info.animate({
                        top: '-=' + distance + 'px',
                        opacity: 0
                    }, time, 'swing', function () {
                        shown = false;
                        info.css('display', 'none');
                    });
 
                }, hideDelay);
 
                return false;
            });
        });
    });
   
    //-->
    </script>

{/literal}

and a javascript file that used in head of site

<script src="demo/jquery.js" type="text/javascript"></script>
but when i reload my site to chek work this tooltip or no
i dont have it
and no tooltip show
where is my problem??????
Back to top
View user's profile Send private message
hassan68
Smarty Rookie


Joined: 27 Apr 2011
Posts: 21

PostPosted: Mon Mar 19, 2012 6:26 am    Post subject: Reply with quote

no one here
no replay
no support
Back to top
View user's profile Send private message
douglassdavis
Smarty Junkie


Joined: 21 Jan 2008
Posts: 541

PostPosted: Mon Mar 19, 2012 12:52 pm    Post subject: Reply with quote

Looks more like a javascript problem than a smarty problem.

If you view the source from your browser are you getting the expected html and javascript code?
Back to top
View user's profile Send private message
hassan68
Smarty Rookie


Joined: 27 Apr 2011
Posts: 21

PostPosted: Mon Mar 19, 2012 5:12 pm    Post subject: Reply with quote

yes


do you have any code or plugin for link tooltip for smarty?
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Mon Mar 19, 2012 5:59 pm    Post subject: Reply with quote

hassan68 wrote:
yes


do you have any code or plugin for link tooltip for smarty?


Just use any javascript tooltip program, and put it in your Smarty template. Check your browser source and javascript console for errors.
Back to top
View user's profile Send private message Visit poster's website
hassan68
Smarty Rookie


Joined: 27 Apr 2011
Posts: 21

PostPosted: Tue Mar 20, 2012 11:28 am    Post subject: Reply with quote

i used it too but this source too not worked
in head

Code:

<script src="javascript/jquery.tools.min.js"></script>
{literal}
<script>
  $(document).ready(function() {
      $("#download_now").tooltip({ effect: 'slide'});
    });
</script>
 
 
{/literal}


and in body

Code:

   <a id="download_now">Download now</a>
 
<!-- tooltip element -->
<div class="tooltip">
 
  <img src="http://jquerytools.org/media/img/title/eye.png" alt="Flying screens"

       style="float:left; margin:0 15px 20px 0" />
 
  <table style="margin:0">
    <tr>
      <td class="label">File</td>
      <td>flowplayer-3.2.7.zip</td>
    </tr>
    <tr>
      <td class="label">Version</td>
      <td>2011-03-03</td>
    </tr>
    <tr>
      <td class="label">Size</td>
      <td>112 kB</td>
    </tr>
    <tr>
      <td class="label">OS</td>
      <td>all</td>
    </tr>
  </table>
 
  <a href="/release-notes">What's new in 3.2</a>
</div>
 
       

demo off tooltip
http://jquerytools.org/demos/tooltip/any-html.htm
i think js file not work
but why i dont know
Question Question
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Mar 20, 2012 3:49 pm    Post subject: Reply with quote

Try this to be certain you get the library loaded:


Code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>


And of course, check the javascript console for errors.
Back to top
View user's profile Send private message Visit poster's website
hassan68
Smarty Rookie


Joined: 27 Apr 2011
Posts: 21

PostPosted: Tue Mar 20, 2012 5:00 pm    Post subject: Reply with quote

tried it and nothing yet
no error
can you add this tooltip to your site and tell me that this code work or no
demo of tooltip
http://jquerytools.org/demos/tooltip/any-html.htm
and
http://jquerytools.org/demos/tooltip/any-html.html
tnx
Back to top
View user's profile Send private message
hassan68
Smarty Rookie


Joined: 27 Apr 2011
Posts: 21

PostPosted: Wed Mar 21, 2012 5:18 pm    Post subject: Reply with quote

problem solved
now
i want too use this js code for more than one div
Code:

{literal}
<script>
  $(document).ready(function() {
      $("#download_now").tooltip({ effect: 'slide'});
    });
</script>
 
 
{/literal}

this code is for just one div
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Mar 21, 2012 7:40 pm    Post subject: Reply with quote

that is a javascript question, but you need to create a real function (not anonymous) that passes the name of the div as a parameter.
Back to top
View user's profile Send private message Visit poster's website
dough boy
Smarty Rookie


Joined: 31 Mar 2006
Posts: 32

PostPosted: Fri Mar 30, 2012 12:55 am    Post subject: Reply with quote

Read up on your jQuery selectors

Code:
$(function () {
$('#div1,#div2').tooltip({ effect: 'slide'});
});


or

Code:
$(function () {
$('div').each(function () {
$(this).tooltip({ effect: 'slide'});
})
});
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP