Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3803930
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:26:21+00:00 2026-05-19T14:26:21+00:00

So, I have this site here where each tile on the page is a

  • 0

So, I have this site here where each “tile” on the page is a bookmark to an external page. However, I had a problem when I used traditional anchor tags and used the jQuery-ui movable and resizable effects on the “tiles”.

The links would remain even after the tiles had been rearranged.

So, I need to try a pure jQuery (or JavaScript if more efficient) solution.

I was thinking of just using window.location and jQuery’s .click() but I need some help inserting this into my preexisting jQuery script.

Here is what I have currently:

$(document).ready(function() {

 // We have a hidden field which knows if the tiles are editable (1) or not (2) now just let's make sure it is initiated with zero value because the startup state of button will be "Edit"
 $("#editable").val('0');

 // Loop through the tiles by class
 $('.tile').each(function(){

  // Get the positions from cookies 
  var toppos = $.cookie('uiposy'+$(this).attr('id'));
  var leftpos = $.cookie('uiposx'+$(this).attr('id'));

  // Apply saved positions
  $(this).css('top',toppos+'px');
  $(this).css('left',leftpos+'px');

  // Get the sizes from cookies 
  var sizew = $.cookie('uisizew'+$(this).attr('id'));
  var sizeh = $.cookie('uisizeh'+$(this).attr('id'));

  // Apply saved sizes
  $(this).css('width',sizew+'px');
  $(this).css('height',sizeh+'px');
 });

 // Set the tiles as draggable
 $('.tile'). 
 draggable({
  containment: '#content',
  scroll: false,
  // Watch out for drag action
  stop: function (event, ui) { 
   // Store x/y positions in a cookie when they're dragged
   $.cookie('uiposx'+$(this).attr('id'), ui.position.left, { path: '/', expires: 7 });
   $.cookie('uiposy'+$(this).attr('id'), ui.position.top, { path: '/', expires: 7 });
  }
 });

 // Set the tiles as resizable
 $('.tile').resizable({
  maxHeight: 200,
  maxWidth: 200,
  minHeight: 100,
  minWidth: 100,
  // Watch out for resize action
  stop: function (event, ui) { 
   // Store width/height values in a cookie when they're resized
   $.cookie('uisizew'+$(this).attr('id'), ui.size.width, { path: '/', expires: 7 });
   $.cookie('uisizeh'+$(this).attr('id'), ui.size.height, { path: '/', expires: 7 });
  }
 }); 

 // Make resiable and draggable disabled on start
 $( ".tile" ).resizable( "option", "disabled", true ).removeClass('ui-state-disabled');
 $( ".tile" ).draggable( "option", "disabled", true ).removeClass('ui-state-disabled');

 // Function to run when the editButton is clicked
 $('#editButton').click(function() {

  // Store our "state" in boolean form. 
  var state = ( $("#editable").val() == 0 ) ? false : true;

  // State is true, this means we will disable the tiles.
  // Make the button text "edit" and change the hidden #editable field value to "0"
  if ( state ) { $("#editable").val('0'); $(this).val('Edit'); $('.tile').css('cursor', 'pointer'); }

  // State is true, this means we will enable the tiles.
  // Make the button text "Done" and change the hidden #editable field value to "1"
  else { $("#editable").val('1'); $(this).val('Done'); $('.tile').css('cursor', 'move'); }

  // Apply the state to tiles. also remove the ui-state-disabled class to make sure they're not faded.
  $( ".tile" ).resizable( "option", "disabled", state ).removeClass('ui-state-disabled');
  $( ".tile" ).draggable( "option", "disabled", state ).removeClass('ui-state-disabled');

 });

});

If anyone has a suggestion on the most efficient way to accomplish this, and where to insert this to code and why, please let me know.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T14:26:22+00:00Added an answer on May 19, 2026 at 2:26 pm

    You can bind a click event handler to your tiles anywhere in your setup function like so:

    $('.tile').bind('click',function (event) {
     if ( $("#editable").val() == 0 ) window.location.href= <your URL here>;
    });
    

    This will only follow the links when your links aren’t editable, otherwise it will be ignored.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using JQuery Accordion. I have this page here: http://www.hauppauge.com/site/support/support_colossus.html#tabs-6 What happens is
ok so i have this problem that i need to achieve...Here is my site
Here is the thing. Right now I have this e-commerce web site where people
this is my first question.. so, here we go. i have a site, 100%
I have a cricket based portal check here cricket scores This site has near
I have this site I've been working on here: http://www.replyonline.co.uk/DirectionGroup/xmas/index.php When you hover over
I have a problem woth floating divs. On this site you can see a
On this site each page is made up of multiple .jsp files. There is
I have my Drupal site here so far: selkirk.treethink.net Each Primary Link at the
Hopefully someone here can help me with this challenge! I have a parent page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.