tipTip problem in rails
First I will tell my tasks:
my layout:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><%= configatron.site_name %></title>
<%= stylesheet_link_merged :base %>
<%= stylesheet_link_tag("tipTip") %>
<%= javascript_include_merged :base %>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<%= stylesheet_link_tag 'mobile' if mobile_device? %>
<%= javascript_include_tag('jquery.simplemodal') %>
<%= javascript_include_tag("jquery.form") %>
<%= javascript_include_tag("jquery.tipTip") %>
<%= javascript_include_tag("jquery.tipTip.minified") %>
<script type="text/javascript">
$j = jQuery.noConflict();
</script>
</head>
<body>
<div id="header">
<!-- my header code -->
</div>
<div id="main">
<%= render :partial => "groups/invite_friends" %>
<%= link_to_function "GANA DINERO CON FISHLE", "basicModal('#invite-friends')" %>
</div>
</body>
</html>
I have the next partial:
<script type="text/javascript">
/*TIP TIP*/
$j(function() {
$j(".quest-import").tipTip({edgeOffset: 5, delay: 100, defaultPosition: "top"});
});
$j(function() {
$j(".quest-social-network").tipTip({edgeOffset: 5, delay: 100, defaultPosition: "top"});
});
</script>
<div class="popup" id="invite-friends">
<% remote_form_for :recommendation, :url => {:controller => "groups", :action => "invite_friend"} do |f| %>
<div class="header">Invita Amigos</div>
<div class="content">
<p>Mensaje de invitación</p>
<!--#comentario-->
<div class="fleft">
<%= image_tag "fishle-logo-medium.png", :width => 115 -%>
<%= text_area_tag "message", nil, :cols => 20, :rows => 4 -%>
<%= image_tag "arrow.png", :width => 60, :style => "margin-bottom: 20px;" -%>
</div>
<div class="text-box">Invita a tus amigos y conocidos o simplemente haz conocer nuestras espectaculares
promociones por el medio que más te guste.
</div>
</div>
<div class="section-small clearfix">
<div id="voice">
<p>Díselo a tus amigos
<%= image_tag "question-mark.png", :class => "quest-social-network", :title => "Corre la voz via facebook, twitter o ambos para formar rapidamente un grupo y aprovechar las ofertas de Fishle" %>
:
</p>
</div>
<div class="small-image-for-invites fleft">
<div id="fb" class="fleft">
<a href="http://www.facebook.com/share.php?u=<%= h "http://#{configatron.site_url}/signup/#{current_user.id}" %>">
<%= image_tag "fb-icon.png", :style => "float: left;" %>
</a>
<a href="http://www.facebook.com/share.php?u=<%= h "http://#{configatron.site_url}/signup/#{current_user.id}" %>" style="margin-top: 4px;">
<span style="margin-top: 4px; float:left">Facebook</span>
</a>
</div>
<div id="tweet" class="fleft">
<a href="http://twitter.com/?status=¿Ya te has apuntado en Fishle? ¡El nuevo concepto de compra! Registrate en <%= h "http://#{configatron.site_url}/signup/#{current_user.id}" %>">
<%= image_tag "twitter-icon.png", :style => "float: left;" %>
<span style="margin-top: 4px; float:left">Twitter</span>
</a>
</div>
</div>
</div>
<div class="section-medium">
<p>
Invita a tus amigos y conseguirás descuentos, packs gratis y acceso a muchas promociones<br/>
<span class="black10">(Separa los correos electrónicos por comas)</span>
<p><%= text_field_tag "email", '', :size => 40 %> <%= f.submit "Enviar" %></p>
</p>
</div>
<% end %>
<div class="section-big">
<div>
<div class="clearfix">
<div class="fleft">
<p>
<span class="fleft">Invita a tus contactos</span>
<span class="small-image-for-invites fleft">
<%= image_tag "question-mark.png", :style =>"position:relative; left:6px;", :class => "quest-import", :title => "Selecciona el provedor de servicios e ingresa tu usuario de email para importar tus contactos e invitarlos a fishle de la manera más rapida" -%>
:
</span>
<br/>
<span class="black10">
(Recomienda el pack a tus contactos)
</span>
</p>
</div>
<div class="medium-image-for-invites"><%= image_tag "yahoo.png" -%></div>
<div class="medium-image-for-invites"><%= image_tag "gmail.png" -%></div>
<div class="medium-image-for-invites"><%= image_tag "winlive.png" %></div>
</div>
</div>
<div>
<h4>Tu dirección de correo electrónico</h4>
<div class="clearfix">
<div id="import-contacts" class="clearfix">
<%= render :partial => "shared/import_contacts" %></div>
</div>
</div>
</div>
</div>
this partial is a popup using simple modal jQuery plugin. OK? I want to use tipTip Jquery plugin in question images (in the code tag script classes)
When open the popup the first time the tipTip plugin work OK. however if I close the popup and then i reopen the popup the tipTip is malfunctioning.
Open Po开发者_开发问答pup in top-left corner of viewport and show in firebug console the next error:
iterator.bind is not a function
[Break On This Error] iterator = iterator.bind(context);
Please I need help about this error.
Excuse my syntax in english and thanks in advance
The problem was that tipTip lose the context handler when i opne popup again. So I refactor the code of popUp in other function in my application.js which first call basicmodal function and then call tipTip selector/attachment.
More Later i post a example
精彩评论