Skip to content

Instantly share code, notes, and snippets.

@filkinsteez
Created July 22, 2013 18:25
Show Gist options
  • Save filkinsteez/6056254 to your computer and use it in GitHub Desktop.
Save filkinsteez/6056254 to your computer and use it in GitHub Desktop.
<div class="container">
<% if @new_manual.present? %>
<% @new_manual.steps.each do |step| %>
<% i_connection = Contact.find(step.input_contact) %>
<span class="i_connection" data-pos-x="<%= i_connection.pos_x %>" data-pos-y="<%= i_connection.pos_y %>" data-pos-width="<%= i_connection.pos_width %>" data-pos-height="<%= i_connection.pos_height %>" data-image=> </span>
<br>
<div class="image_panel">
<%= image_tag(i_connection.image.image.url(:large)) %>
<div class='i_connection'></div>
</div>
<% end %>
<% end %>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("span.i_connection").each(function() {
var pos_width = $(this).data('pos-width');
var pos_height = $(this).data('pos-height');
var xpos = $(this).data('pos-x');
var ypos = $(this).data('pos-y');
$(".tagged_box").css("display","block");
$(".tagged").css("border","5px solid red");
$('.i_connection').append('<div class="tagged" style="width:'+pos_width+'px;height:'+pos_height+'px;left:'+xpos+'px;top:'+ypos+'px; position:absolute;" ><div class="tagged_box" style="width:'+pos_width+'px;height:'+
pos_height+'px; position:absolute;"></div>')
}); //END OF SPAN.CONNECTION ITERATION
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment