This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

position errorbox
#1

I'm trying to relocate the position of the error box that appears when you try to vote your own comment.
Now it appears outside view, below the viewport.

Though the style of 
Code:
.cmtx_error_ajax {
    cursor: default;
    position: absolute; /* << */
    margin-top: 10px; /* << */
    margin-left: 10px; /* << */
    padding: 3px;
    color: #FF0000;
    font-size: 0.8em;
    font-weight: bold;
    font-family: "Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
    border: 1px solid #FF0000;
    background-color: #FFFFFF;
    display: none;
}

should position the box right. Changing the margin values has no effect.
Should I do this in another way then?
Reply
#2

The JavaScript for that feature is designed to position the error box wherever the mouse cursor is. It works by adding the CSS styles 'top' and 'left'. I'm not sure why it's not working for your site. Do you have a link so I can try to find out?

This is the code from /upload/includes/template/comments.php

Code:
jQuery('.cmtx_error_ajax').clearQueue();
jQuery('.cmtx_error_ajax').html(response);
jQuery('.cmtx_error_ajax').css('top', e.pageY);
jQuery('.cmtx_error_ajax').css('left', e.pageX);
jQuery('.cmtx_error_ajax').fadeIn(500).delay(2000).fadeOut(500);

Have you completed the interview?
Reply
#3

It appears to be because of the following in your /bin/style/style.css file:

Code:
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
 position: relative;
 min-height: 1px;
 padding-right: 15px;
 padding-left: 15px;
}

Have you completed the interview?
Reply
#4

You're right. When I remove the css style
Code:
position: relative;

the errorbox appears on the correct spot.
However, that style is an important part of the Bootstrap framework, so I can't remove that.

So in my case I've changed the jquery to:


Code:
jQuery('.cmtx_error_ajax').css('top', e.pageY - 200);
jQuery('.cmtx_error_ajax').css('left', e.pageX - 400);
and now the error box is shown correct, right below every button that is clicked.

Thanks for your help Steven
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by aercan
05-Dec-2014, 10:44 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)