Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 04-02-2017, 03:39 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 67,948
Dinocanid is on a distinguished road
Default Pet background alignment issues

I have a background system on my site that semi-works right now, which still needs lots of tweaking, but I have a problem with the background going over the tables or the adopt hovering outside of the background:




I currently have my css like this:
Code:
.decor {
position: absolute;
    top: 26%;
    left: 49%;
    z-index: 1;
}
.adopt {
position: relative;
    z-index: 2;
and my code like this:
PHP Code:
$background $adopt->getAdoptBackground();
$image $adopt->getImage("gui");

$document->add(new Comment("<div class = 'adopt'>"));
      
$document->add($image);
      
       
$document->add(new Comment("<center>"));
        if (
$background == ""){

        
$document->add($image);
        }
      else{
      
$document->add(new Comment("<div class = 'adopt'>"));
      
$document->add($image);
      
        
$document->add(new Comment("</div>"));
        
//$document->add(new Comment("<br></br>"));
        
$document->add(new Comment ("<div class='decor'><img src='{$mysidia->path->getAbsolute()}picuploads/backgrounds/{$background}.png'</div>"));
        }
        
$document->add(new Comment("</center>")); 
(Not the exact/full myadopts.php code, but the snippets I'm referring to)

I've done a lot of adjusting to the css, but all of my pet images are different sizes, so I can't get every one to fit correctly; unless I had separate sections in the css code for every adoptable with background issues, but I can see that getting tedious as more and more species are added. I tried not using positioning and only adjusting the z-index, but that causes the pet to appear either above, below, or beside the background, and not in it.
__________________
Reply With Quote
  #2  
Old 04-10-2017, 10:52 AM
Silver_Brick Silver_Brick is offline
Designer || Coder
 
Join Date: Oct 2016
Location: In Earth
Posts: 205
Gender: Male
Credits: 28,034
Silver_Brick is on a distinguished road
Default

I will fix it today or tommorow for you :)
Reply With Quote
  #3  
Old 04-10-2017, 04:50 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 117,525
Abronsyth is on a distinguished road
Default

Quote:
...but all of my pet images are different sizes...
My answer to this on my website was to take the largest pet image and scale the backgrounds to that pet, so that way each background will fit all pets. Then, instead of having the background and pet as separate elements, set the pet in a div of its own and set the background to appear as whichever background is equipped.
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #4  
Old 04-10-2017, 07:19 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 67,948
Dinocanid is on a distinguished road
Default

So don't put the background in a div?
__________________
Reply With Quote
  #5  
Old 04-11-2017, 07:22 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 117,525
Abronsyth is on a distinguished road
Default

Yeah, rather try something like this;
PHP Code:
<div style='background:url({$mysidia->path->getAbsolute()}picuploads/backgrounds/{$background}.png);'>pet image code here</div
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:54 PM.

Currently Active Users: 888 (0 members and 888 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636