P
P
Pavel2016-06-08 17:39:17
JavaScript
Pavel, 2016-06-08 17:39:17

Is it possible to make this adaptive?

You need to convert the template to joomla.
The designer provided a layout drawn for a certain resolution...
The client wants an effect, I have not encountered such an effect, I will try to describe it....
div10 Top block, background image, logo, menu.... Width 100%
div20 Block with a slider. Width 100%
div30 Content, width 80%
div40 footer, width 80%
When scrolling the slider, the div10 block must remain on the screen (fixed?), in addition, there must be another div25 block on the main page, it must be stuck to the div10 block when the slider disappears.
How to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Alekseev, 2016-06-09
@shure348

div10 fixed,
div10 parent padding-top: div10 height
for div25

$(window).scroll(function(){
  var $body = $("body");
  if ( $(this).scrollTop() > 'высота до div25 минус высота div10'){
      $body.addClass("fixed");
  } else if($(this).scrollTop() <= 'высота до div25 минус высота div10' && $body.hasClass("fixed")) {
      $body.removeClass("fixed");
  }
});

when scrolling by a certain amount, the fixed class is added to the body
and a new style dances from it to div25
body.fixed .div25 { position: fixed;}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question