JavaScript
- 5 ответов
- 0 вопросов
3
Вклад в тег
var offsetTop = Element.getBoundingClientRect().top + document.body.scrollTop;<html>
<head>
<title>afdafasdfasd</title>
</head>
<body>
<div>11</div>
<div>11</div>
<div>11</div>
<div>11</div>
<div>11</div>
<div>11</div>
<div id='test'>TESTTESTTEST</div>
<script type="text/javascript">
console.log(document.getElementById('test').getBoundingClientRect().top + document.body.scrollTop);
</script>
</body>
</html>interface MessagesRepository {
// Выбрать все сообщение
public function all();
// Выбрать сообщение по id
public function findById($id);
//Записать сообщение
public function store($id, $userId);
}protected $messages;
public function __construct(MessagesRepository $messages){
$this->messages = $messages;
}
public function index() {
return view('messages.index')-with('messages', $this->messages->all());
}$this->app->bind(
'App\Repositories\Messages\MessagesRepository',
'App\Repositories\Messages\MysqlMessagesRepository'
);class MysqlMessagesRepository implements MessagesRepository {
// Выбрать все сообщение
public function all() {
MysqlGetAllMessages();
}
// Выбрать сообщение по id
public function findById($id);
//Записать сообщение
public function store($id, $userId);
}class RedisMessagesRepository implements MessagesRepository {
// Выбрать все сообщение
public function all() {
RedisGetAllMessages();
}
// Выбрать сообщение по id
public function findById($id);
//Записать сообщение
public function store($id, $userId);
}$this->app->bind(
'App\Repositories\Messages\MessagesRepository',
'App\Repositories\Messages\RedisMessagesRepository'
);// the plugin initializer
$.fn.galleria = function( options ) {
return this.each(function() {
var gallery = new Galleria();
gallery.init( this, options );
});
};
// Expose
window.Galleria = Galleria;var gallery = new Galleria();
gallery.init( $('#galleria'));gallery.updateCarousel();